Skip to content

[Image Redux] An image URL's fragment directive hides the fragment before it - #78230

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
weinig:eng/svg-image-fragment-directive
Oct 25, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
weinig:eng/svg-image-fragment-directive

Conversation

@weinig

@weinig weinig commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

701620c

[Image Redux] An image URL's fragment directive hides the fragment before it
https://bugs.webkit.org/show_bug.cgi?id=328791

Reviewed by Darin Adler.

Removes the fragment directive from a URL before passing the fragment to an SVG image. For example, an image URL
like foo.svg#box:~:param(--bg, green) was previously passing "box:~:param(--bg, green)" to the SVG element as
the target and now just passes "box" (the "param(--bg, green)" is passed separately as link parameters already).
No spec says whether this is the correct behavior, but it really is the only thing that makes sense. I have filed
w3c/csswg-drafts#14656 to track getting the specs updated.

Also removes CursorImage's override of drawingExtrasForRenderer() which was unnecessary and incomplete. Instead,
the default implementation in MultiImage that forwards is used.

Tests: imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background.html
       imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier.html
       Tools/TestWebKitAPI/Tests/WTF/Vector.cpp
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/resources/target.svg: Added.
* Source/WTF/wtf/Vector.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LinkParameters.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LinkParameters.h:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.h:
* Source/WebCore/style/values/images/kinds/StyleCursorImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCursorImage.h:
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:

Canonical link: https://commits.webkit.org/324650@main

40ab1b1

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-cmake-debug   🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-cmake-debug ✅ 🧪 jsc-wpe
✅ 🧪 jsc-x86-64 ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 🧪 jsc-debug-arm64 loading 🛠 ios-safer-cpp   🧪 mac-cmake-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision   🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 🧪 merge ✅ 🛠 vision-sim   🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@weinig
weinig requested a review from a team as a code owner October 25, 2026 15:51
@weinig weinig self-assigned this Oct 25, 2026
@weinig weinig added the Images For bugs in image handling. label Oct 25, 2026
@weinig
weinig force-pushed the eng/svg-image-fragment-directive branch from b0ec102 to 40ab1b1 Compare October 25, 2026 15:54
@weinig weinig added the merge-queue Applied to send a pull request to merge-queue label Oct 25, 2026
…fore it

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

Reviewed by Darin Adler.

Removes the fragment directive from a URL before passing the fragment to an SVG image. For example, an image URL
like foo.svg#box:~:param(--bg, green) was previously passing "box:~:param(--bg, green)" to the SVG element as
the target and now just passes "box" (the "param(--bg, green)" is passed separately as link parameters already).
No spec says whether this is the correct behavior, but it really is the only thing that makes sense. I have filed
w3c/csswg-drafts#14656 to track getting the specs updated.

Also removes CursorImage's override of drawingExtrasForRenderer() which was unnecessary and incomplete. Instead,
the default implementation in MultiImage that forwards is used.

Tests: imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background.html
       imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier.html
       Tools/TestWebKitAPI/Tests/WTF/Vector.cpp
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-background.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/link-parameters-fragment-identifier.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/css-linked-parameters/resources/target.svg: Added.
* Source/WTF/wtf/Vector.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LinkParameters.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LinkParameters.h:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.h:
* Source/WebCore/style/values/images/kinds/StyleCursorImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCursorImage.h:
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:

Canonical link: https://commits.webkit.org/324650@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/svg-image-fragment-directive branch from 40ab1b1 to 701620c Compare October 25, 2026 19:50
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 324650@main (701620c): https://commits.webkit.org/324650@main

Reviewed commits have been landed. Closing PR #78230 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 701620c into WebKit:main Oct 25, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Images For bugs in image handling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants