Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c6bd8acdac1fdbc4f3836f5841a207e24cb2bc46
      
https://github.com/WebKit/WebKit/commit/c6bd8acdac1fdbc4f3836f5841a207e24cb2bc46
  Author: Karl Dubost <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/currentScale-outermost-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/currentScale-outermost.html
    M Source/WebCore/svg/SVGSVGElement.cpp
    M Source/WebCore/svg/SVGSVGElement.h

  Log Message:
  -----------
  SVGSVGElement.currentScale is a no-op on non-document-root outermost <svg>
https://bugs.webkit.org/show_bug.cgi?id=318096
rdar://180889449

Reviewed by Nikolas Zimmermann.

currentScale was implemented purely as the main frame's page zoom,
gated on the <svg> being the document root (frameForCurrentScale() requires
document().documentElement() == this).

As a result, setting currentScale on an outermost <svg> embedded in HTML
(inline, or inside a foreignObject) was silently discarded. The getter
returned 1, whereas SVG 2 ("Interface SVGSVGElement") only mandates that
behavior for non-outermost svg elements. Chrome and Firefox both
round-trip the value; WebKit was the outlier.

Store the assigned value in a new SVGSVGElement::m_currentScale member
and return it for an outermost svg element that is not the document root.
The document root continues to map currentScale to page zoom, so its
rendering is unchanged.

As with Gecko, the stored value is not reflected into rendering for
non-root outermost elements (only Blink does that; the existing
currentScale-change-repaint.html reftest indicate that area is
underspecified), so this change is limited to the web-observable
getter/setter round-trip. We need more discussions in the SVG WG.

Test: 
imported/w3c/web-platform-tests/svg/struct/scripted/currentScale-outermost.html

* 
LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/currentScale-outermost-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/struct/scripted/currentScale-outermost.html:
 Added.
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentScale const):
(WebCore::SVGSVGElement::setCurrentScale):
* Source/WebCore/svg/SVGSVGElement.h:

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



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

Reply via email to