Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9db42a8aaf4a56d40c3642fbad90599174952696
      
https://github.com/WebKit/WebKit/commit/9db42a8aaf4a56d40c3642fbad90599174952696
  Author: Karl Dubost <[email protected]>
  Date:   2026-06-26 (Fri, 26 Jun 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/height-computed-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/width-computed-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-special-cases-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-special-cases.html
    M 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/imported/w3c/web-platform-tests/svg/geometry/parsing/height-computed-expected.txt
    M 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/imported/w3c/web-platform-tests/svg/geometry/parsing/width-computed-expected.txt
    M LayoutTests/svg/css/parse-calc-length-expected.txt
    M LayoutTests/svg/css/parse-calc-length.html
    M LayoutTests/svg/css/parse-length-expected.txt
    M LayoutTests/svg/css/parse-length.html
    M Source/WebCore/svg/SVGElement.cpp
    M Source/WebCore/svg/SVGElement.h
    M Source/WebCore/svg/SVGFilterElement.cpp
    M Source/WebCore/svg/SVGFontFaceElement.cpp
    M Source/WebCore/svg/SVGMaskElement.cpp
    M Source/WebCore/svg/SVGPathElement.cpp
    M Source/WebCore/svg/SVGPatternElement.cpp

  Log Message:
  -----------
  SVG2 geometry presentation attributes accepted on wrong elements such as g
https://bugs.webkit.org/show_bug.cgi?id=313380
rdar://175672111

Reviewed by Nikolas Zimmermann.

WebKit treated the SVG2 geometry attributes (cx, cy, r, rx, ry,
x, y, width, height, d) as CSS presentation attributes on every
SVG element. Per SVG2 each is a presentation attribute only on
its owning elements; elsewhere getComputedStyle must return the
initial value.

Fold the element-restriction check inline into
SVGElement::cssPropertyIdForSVGAttributeName: each geometry case
returns its CSS property only when *this is an owning element
type, otherwise CSSPropertyInvalid. The mapping stays non-virtual.

* cx, cy: circle, ellipse
* r: circle
* rx, ry: ellipse, rect
* x, y: foreignObject, image, rect, svg, symbol, use
* width, height: foreignObject, image, rect, outermost svg only
* d: path (gated by Settings::cssDPropertyEnabled)

Drop now-unnecessary setPresentationalHintStyleIsDirty() from
SVGFilterElement, SVGMaskElement, SVGPatternElement. Refactor
parse-length.html / parse-calc-length.html to use spec-correct
elements (circle for cx/cy/r).

Spec: https://w3c.github.io/svgwg/svg2-draft/geometry.html

* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/height-computed-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/parsing/width-computed-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-special-cases-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-special-cases.html:
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/imported/w3c/web-platform-tests/svg/geometry/parsing/height-computed-expected.txt:
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/imported/w3c/web-platform-tests/svg/geometry/parsing/width-computed-expected.txt:
* LayoutTests/svg/css/parse-calc-length-expected.txt:
* LayoutTests/svg/css/parse-calc-length.html:
* LayoutTests/svg/css/parse-length-expected.txt:
* LayoutTests/svg/css/parse-length.html:
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::cssPropertyIdForSVGAttributeName const):
(WebCore::SVGElement::hasPresentationalHintsForAttribute const):
(WebCore::SVGElement::collectPresentationalHintsForAttribute):
(WebCore::SVGElement::svgAttributeChanged):
(WebCore::SVGElement::cssPropertyIdForSVGAttributeName): Deleted.
* Source/WebCore/svg/SVGElement.h:
* Source/WebCore/svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::svgAttributeChanged):
* Source/WebCore/svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::attributeChanged):
* Source/WebCore/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::svgAttributeChanged):
* Source/WebCore/svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::collectDPresentationalHint):
* Source/WebCore/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::svgAttributeChanged):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to