Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 27a59f0ec20efd6724c6b8d6ba49d5d47baf52b8
      
https://github.com/WebKit/WebKit/commit/27a59f0ec20efd6724c6b8d6ba49d5d47baf52b8
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-05 (Wed, 05 Aug 2026)

  Changed paths:
    A 
LayoutTests/svg/foreignObject/foreignobject-svgdom-x-property-update-expected.html
    A LayoutTests/svg/foreignObject/foreignobject-svgdom-x-property-update.html
    A 
LayoutTests/svg/foreignObject/foreignobject-svgdom-y-property-update-expected.html
    A LayoutTests/svg/foreignObject/foreignobject-svgdom-y-property-update.html
    M Source/WebCore/svg/SVGForeignObjectElement.cpp

  Log Message:
  -----------
  REGRESSION(313859@main): SVGForeignObjectElement dynamic x/y take no effect
https://bugs.webkit.org/show_bug.cgi?id=321122

Reviewed by Sam Weinig.

Since 313859@main, LegacyRenderSVGForeignObject::layout() (and the LBSE
RenderSVGForeignObject::layout()) derive the viewport geometry from the
resolved style instead of the SVG animated properties. The x/y/width/height
attributes are presentation attributes mapped to the CSS x/y/width/height
properties, so the resolved style must be invalidated when they change.

SVGForeignObjectElement::svgAttributeChanged() only marked the presentational
hint style dirty for width/height. For x/y it invalidated the renderer without
refreshing the presentation style, so a style recalc never happened and layout
kept reading the stale x/y. Updating x/y via the SVG DOM property
(x.baseVal.value = ...) therefore left the foreignObject at its old position.

Mark the presentational hint style dirty for all four geometry attributes,
matching how SVGRectElement handles its geometry attributes, and keep updating
the relative-lengths information for x/y.

Added new reftests to verify this functionality instead of relying on
svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html which only
verify the logic through pixel testing, which isn't executed by default.

* 
LayoutTests/svg/foreignObject/foreignobject-svgdom-x-property-update-expected.html:
 Added.
* LayoutTests/svg/foreignObject/foreignobject-svgdom-x-property-update.html: 
Added.
* 
LayoutTests/svg/foreignObject/foreignobject-svgdom-y-property-update-expected.html:
 Added.
* LayoutTests/svg/foreignObject/foreignobject-svgdom-y-property-update.html: 
Added.
* Source/WebCore/svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):

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



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

Reply via email to