Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ea6f87ed951e23583099f071feac8f878454f948
      
https://github.com/WebKit/WebKit/commit/ea6f87ed951e23583099f071feac8f878454f948
  Author: Taher Ali <[email protected]>
  Date:   2025-09-05 (Fri, 05 Sep 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units.html
    M Source/WebCore/svg/SVGLengthContext.cpp
    M Source/WebCore/svg/SVGLengthContext.h

  Log Message:
  -----------
  Remove zoom on font-relative units when resolving SVGLengthValue
https://bugs.webkit.org/show_bug.cgi?id=298102
rdar://159448970

Reviewed by Tim Nguyen.

Currently, when resolving SVGLengthValue, somewhere in the callstack
we call computeUnzoomedNonCalcLengthDouble to get user units as the
final value. This value can sometimes be resolved against the computed
font size, which may or may not include zoom when units are
font-relative or root font-relative.

In SVG contexts when using font-relative units, we expect these values
to be unzoomed because SVG applies zoom during layout-time
at viewport level. (see RenderSVGViewportContainer)

Ideally, a routine named "computeUnzoomed*" should guarantee
non-zoomed values, but this isn't the case.

This PR removes the applied zoom for font-relative or root
font-relative units in SVG length context.

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/svg-font-relative-units.html:
 Added.
* Source/WebCore/svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::computeNonCalcLength const):
(WebCore::SVGLengthContext::removeZoomFromFontOrRootFontRelativeLength const):
* Source/WebCore/svg/SVGLengthContext.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to