Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 491091b849b28fd0ed7d566ff7946475b50d5eb1
https://github.com/WebKit/WebKit/commit/491091b849b28fd0ed7d566ff7946475b50d5eb1
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/svg/SVGClipPathElement.h
M Source/WebCore/svg/SVGMaskElement.h
M Source/WebCore/svg/SVGPatternElement.h
Log Message:
-----------
SVG conditional processing attributes on clipPath, mask and pattern wrongly
prevent the resource from being referenced
https://bugs.webkit.org/show_bug.cgi?id=139117
rdar://19103270
Reviewed by Said Abou-Hallawa.
This patch aligns WebKit with Gecko / Firefox.
Per SVG 2 ยง5.6.1, conditional processing attributes (systemLanguage,
requiredExtensions) "only affect the direct rendering of elements and do not
prevent elements from being successfully referenced by other elements", and
"conditional processing will have no effect on never-rendered elements".
(https://w3c.github.io/svgwg/svg2-draft/struct.html#ConditionalProcessingOverview)
clipPath, mask and pattern are never-rendered resource elements, only
referenced via url(). A conditional processing attribute placed on the
resource element itself must therefore be ignored. But SVGClipPathElement,
SVGMaskElement and SVGPatternElement overrode isValid() to return
SVGTests::isValid(), which SVGElement::childShouldCreateRenderer() consults, so
a failing systemLanguage on the resource element suppressed its renderer and
the reference silently failed. (filter and gradients lack SVGTests, so they
were already correct.)
Remove the override so these elements fall back to SVGElement::isValid()
(always true) and stay referenceable. SVGTests is retained so the DOM
attributes are still exposed, just not used for rendering.
This does not change how conditional processing applies to the resource's
*children*: the attribute is ignored on the container but still honored on the
content elements inside it, per the spec's note that "conditional processing
of child content of a never-rendered container [...] will affect whether that
child content contributes to the graphical effect". For example:
<pattern systemLanguage="foo">
<rect systemLanguage="bar"/>
</pattern>
systemLanguage on <pattern> is now ignored (the pattern is still
referenceable), while systemLanguage on the child <rect> is still honored,
because child graphics elements keep their own isValid() overrides that
childShouldCreateRenderer() continues to gate.
* LayoutTests/TestExpectations: Unskip the now-passing test.
* Source/WebCore/svg/SVGClipPathElement.h:
* Source/WebCore/svg/SVGMaskElement.h:
* Source/WebCore/svg/SVGPatternElement.h:
Remove the isValid() override that consulted SVGTests::isValid().
Canonical link: https://commits.webkit.org/320207@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications