Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 94ce6308f5028935574e1f569f55df46de8a0473
https://github.com/WebKit/WebKit/commit/94ce6308f5028935574e1f569f55df46de8a0473
Author: Karl Dubost <[email protected]>
Date: 2026-04-17 (Fri, 17 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/svg/struct/systemLanguage-parsing-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/svg/struct/systemLanguage-parsing.html
M
LayoutTests/svg/dom/svg-list-properties-parser-leading-trailing-spaces-expected.txt
M
LayoutTests/svg/dom/svg-list-properties-parser-leading-trailing-spaces.html
M Source/WebCore/svg/SVGStringList.cpp
M Source/WebCore/svg/SVGStringList.h
M Source/WebCore/svg/SVGTests.cpp
Log Message:
-----------
Parse 'systemLanguage' as a comma separated list
https://bugs.webkit.org/show_bug.cgi?id=262146
rdar://116427520
Reviewed by Darin Adler and Nikolas Zimmermann.
The SVG2 specification defines systemLanguage as
"a set of comma-separated tokens" (per the HTML definition),
where each token is a BCP 47 language tag. WebKit was parsing
it as space-separated, which meant "en,fr,de" was treated as
a single token.
SVGStringList now exposes two public methods:
* setFromCommaSeparatedTokens()
* setFromSpaceSeparatedTokens()
and as two private methods:
* parseCommaSeparatedTokens()
* parseSpaceSeparatedTokens()
systemLanguage uses the comma path;
requiredExtensions continues to use the space path.
Note: This PR is about parsing only. The validation logic
(matching user preferences against the parsed tags) is tracked
separately in https://webkit.org/b/262140.
Note: This also invites to create a more general parseCommaSeparatedTokens
and parseSpaceSeparatedTokens, because there are other parts of WebCore
using similar needs. See https://webkit.org/b/312153.
Spec:
https://w3c.github.io/svgwg/svg2-draft/struct.html#ConditionalProcessingSystemLanguageAttribute
An issue has been opened on the spec to clarify it too.
https://github.com/w3c/svgwg/issues/1089
Test: imported/w3c/web-platform-tests/svg/struct/systemLanguage-parsing.html
*
LayoutTests/imported/w3c/web-platform-tests/svg/struct/systemLanguage-parsing-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/struct/systemLanguage-parsing.html:
Added.
*
LayoutTests/svg/dom/svg-list-properties-parser-leading-trailing-spaces-expected.txt:
* LayoutTests/svg/dom/svg-list-properties-parser-leading-trailing-spaces.html:
* Source/WebCore/svg/SVGStringList.cpp:
(WebCore::SVGStringList::setFromCommaSeparatedTokens):
(WebCore::SVGStringList::setFromSpaceSeparatedTokens):
(WebCore::SVGStringList::parseCommaSeparatedTokens):
(WebCore::SVGStringList::parseSpaceSeparatedTokens):
(WebCore::SVGStringList::valueAsString const):
(WebCore::SVGStringList::parse): Deleted.
* Source/WebCore/svg/SVGStringList.h:
* Source/WebCore/svg/SVGTests.cpp:
(WebCore::SVGTests::parseAttribute):
Canonical link: https://commits.webkit.org/311439@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications