Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8be100449e659f802ebf29f1ba426182693d230e
https://github.com/WebKit/WebKit/commit/8be100449e659f802ebf29f1ba426182693d230e
Author: Ahmad Saleem <[email protected]>
Date: 2026-01-28 (Wed, 28 Jan 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/reftests/css-color-visited-currentcolor-svg-fill-expected.xht
A
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/reftests/css-color-visited-currentcolor-svg-fill.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/svg-fill-currentcolor-visited-getcomputedstyle-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/svg-fill-currentcolor-visited-getcomputedstyle.html
M Source/WebCore/rendering/svg/SVGPaintServerHandlingInlines.h
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResource.cpp
Log Message:
-----------
`:visited` link color does not propagate to SVG through `currentColor`
https://bugs.webkit.org/show_bug.cgi?id=244025
rdar://98776770
Reviewed by Nikolas Zimmermann and Antti Koivisto.
This patch aligns WebKit with Blink / Chromium.
When an SVG element uses fill="currentColor" or stroke="currentColor"
inside a :visited link, the color should resolve to the visited link
color, not the unvisited link color.
Previously, the code would skip currentColor handling in the visited
link block because it assumed the color was already resolved correctly.
However, the initial color resolution always used the non-visited style,
causing currentColor to resolve to the wrong color for visited links.
This fix explicitly handles the currentColor case within the visited
link block, ensuring it resolves to style.visitedLinkColor() for both
fill and stroke attributes.
Credits to `Masataka Yakura` for Test Case.
NOTE: This patch fixes the bug in both LegacySVG and Layer Based SVG engine.
Test:
imported/w3c/web-platform-tests/svg/pservers/reftests/css-color-visited-currentcolor-svg-fill.html
imported/w3c/web-platform-tests/svg/pservers/scripted/svg-fill-currentcolor-visited-getcomputedstyle.html
*
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/reftests/css-color-visited-currentcolor-svg-fill-expected.xht:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/reftests/css-color-visited-currentcolor-svg-fill.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/svg-fill-currentcolor-visited-getcomputedstyle-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/svg-fill-currentcolor-visited-getcomputedstyle.html:
Added.
* Source/WebCore/rendering/svg/SVGPaintServerHandlingInlines.h:
(WebCore::SVGPaintServerHandling::resolveColorFromStyle):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResource.cpp:
(WebCore::requestPaintingResource):
Canonical link: https://commits.webkit.org/306387@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications