Skip to content

Conversation

@lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Aug 26, 2025

Align type and media
attributes from
SVGStyleElement with HTMLStyleElement

  • type and media no longer have an initial value
  • type is obsoleted

This aligns the behaviour with Firefox and with the HTMLStyleElement.

WebKit Bug: https://bugs.webkit.org/show_bug.cgi?id=297909 (Fixed to match this behaviour)
Firefox Bug: N/A (Current behaviour)
Chromium Bug: https://issues.chromium.org/u/1/issues/441253575

WPT Changes: web-platform-tests/wpt#54529

Fixes #996 and #995

…ement

- type and media no longer have an initial value
- type is obsoleted
lukewarlow added a commit to lukewarlow/WebKit that referenced this pull request Aug 26, 2025
https://bugs.webkit.org/show_bug.cgi?id=297909

Reviewed by NOBODY (OOPS!).

See w3c/svgwg#1001

This aligns SVGStyleElement type and media to use pure attribute reflection which matches how HTMLStyleElement works.

This aligns WebKit with Firefox/Gecko.

* LayoutTests/imported/w3c/web-platform-tests/svg/styling/attr-style-media-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/attr-style-media.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/attr-style-type-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/svg/styling/attr-style-type.html: Added.
* Source/WebCore/svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type const): Deleted.
(WebCore::SVGStyleElement::setType): Deleted.
(WebCore::SVGStyleElement::media const): Deleted.
(WebCore::SVGStyleElement::setMedia): Deleted.
* Source/WebCore/svg/SVGStyleElement.h:
* Source/WebCore/svg/SVGStyleElement.idl:
lukewarlow added a commit to lukewarlow/WebKit that referenced this pull request Aug 27, 2025
https://bugs.webkit.org/show_bug.cgi?id=297909

Reviewed by NOBODY (OOPS!).

See w3c/svgwg#1001

This aligns SVGStyleElement type and media to use pure attribute reflection which matches how HTMLStyleElement works.

This aligns WebKit with Firefox/Gecko.
webkit-commit-queue pushed a commit to lukewarlow/WebKit that referenced this pull request Aug 28, 2025
https://bugs.webkit.org/show_bug.cgi?id=297909

Reviewed by Tim Nguyen.

See w3c/svgwg#1001

This aligns SVGStyleElement type and media to use pure attribute reflection which matches how HTMLStyleElement works.

This aligns WebKit with Firefox/Gecko.

Canonical link: https://commits.webkit.org/299252@main
Jarred-Sumner pushed a commit to oven-sh/WebKit that referenced this pull request Aug 29, 2025
https://bugs.webkit.org/show_bug.cgi?id=297909

Reviewed by Tim Nguyen.

See w3c/svgwg#1001

This aligns SVGStyleElement type and media to use pure attribute reflection which matches how HTMLStyleElement works.

This aligns WebKit with Firefox/Gecko.

Canonical link: https://commits.webkit.org/299252@main
@karlcow
Copy link
Member

karlcow commented Sep 29, 2025

https://wpt.fyi/results/svg/styling/attr-style-media.html
https://wpt.fyi/results/svg/styling/attr-style-type.html

Firefox and Safari are now aligned.

@lukewarlow I have the feeling that the beginning of your issues has been eaten by a cookie monster. Is there a PR? You would like to make on the SVG spec?

@lukewarlow
Copy link
Member Author

This is the PR. I'll fix OP in a bit.

@karlcow
Copy link
Member

karlcow commented Sep 29, 2025

/me put his eyes in his eye sockets again. Sorry. :D

@karlcow
Copy link
Member

karlcow commented Oct 9, 2025

RESOLUTION: 'type' attribute to be deprecated. 'media' attribute resolution deferred for now.
https://www.w3.org/2025/10/09-svg-minutes.html#26fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What should SVGStyleElement.type return when type attribute is missing?

3 participants