[Webkit-unassigned] [Bug 262146] Parse 'systemLanguage' as a comma separated list

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 27 00:50:53 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=262146

--- Comment #2 from Karl Dubost <karlcow at apple.com> ---
data:text/html,<svg><text systemLanguage="en-US, zh-Hans,zh-Hant"></text></svg>

document.querySelector('text').systemLanguage
returns an SVGStringList with indeed

* en-US,
* zh-Hans,zh-Hant


even  with a simpler test
data:text/html,<svg><text systemLanguage="en,fr,de"></text></svg>

it returns
* en,fr,de


That's bad indeed. I never gets it right


"en,fr,de"   -> { 0: "en,fr,de" }
"en, ,de"    -> { 0: "en,", 1: ",de" }
"en,,de"     -> { 0: "en,,de" }
"en,,de"     -> { 0: "en,,de" }
"en, fr, de" -> { 0: "en,", 1: "fr,", 3: "de" }

It separates on space, and never removes the comma. 

What does the spec says?
https://www.w3.org/TR/SVG2/struct.html#ConditionalProcessingSystemLanguageAttribute


Name:    systemLanguage 
Value:   set of comma-separated tokens [HTML]   
Initial: (none) 


defined in https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#set-of-comma-separated-tokens


A set of comma-separated tokens is a string containing zero or more tokens each separated from the next by a single U+002C COMMA character (,), where tokens consist of any string of zero or more characters, neither beginning nor ending with ASCII whitespace, nor containing any U+002C COMMA characters (,), and optionally surrounded by ASCII whitespace.

For instance, the string " a ,b,,d d " consists of four tokens: "a", "b", the empty string, and "d d". Leading and trailing whitespace around each token doesn't count as part of the token, and the empty string can be a token.


The confusion comes probably from when it was written because 
requiredExtensions is a **space** separated attribute.
https://www.w3.org/TR/SVG2/struct.html#ConditionalProcessingRequiredExtensionsAttribute

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230927/920da559/attachment.htm>


More information about the webkit-unassigned mailing list