Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5ed9fc92e49bbc1d3e39664442c486ffb2009a60
      
https://github.com/WebKit/WebKit/commit/5ed9fc92e49bbc1d3e39664442c486ffb2009a60
  Author: Karl Dubost <[email protected]>
  Date:   2026-05-26 (Tue, 26 May 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-baseval-in-display-none-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-baseval-in-display-none.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-length-convert-to-percentage-precision-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-length-convert-to-percentage-precision.html
    M 
LayoutTests/platform/glib/svg/custom/image-with-transform-clip-filter-expected.txt
    M 
LayoutTests/platform/ios/svg/custom/image-with-transform-clip-filter-expected.txt
    R 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/image-with-transform-clip-filter-expected.txt
    R 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/filters/feImage-preserveAspectRatio-all-expected.txt
    R 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/filters/feImage-preserveAspectratio-expected.txt
    M 
LayoutTests/platform/mac/svg/custom/image-with-transform-clip-filter-expected.png
    R 
LayoutTests/platform/mac/svg/custom/image-with-transform-clip-filter-expected.txt
    M 
LayoutTests/platform/mac/svg/filters/feImage-preserveAspectratio-expected.png
    R 
LayoutTests/platform/win/svg/custom/image-with-transform-clip-filter-expected.txt
    A LayoutTests/svg/custom/image-with-transform-clip-filter-expected.txt
    M LayoutTests/svg/filters/feImage-preserveAspectRatio-all-expected.png
    M LayoutTests/svg/filters/feImage-preserveAspectRatio-all-expected.txt
    M LayoutTests/svg/filters/feImage-preserveAspectratio-expected.txt
    M Source/WebCore/svg/SVGLengthContext.cpp
    M Source/WebCore/svg/SVGLengthContext.h
    M Source/WebCore/svg/SVGLengthValue.cpp

  Log Message:
  -----------
  rounding issue for svg rect height with em and percentage
https://bugs.webkit.org/show_bug.cgi?id=309035
rdar://171587382

Reviewed by Nikolas Zimmermann (OOPS\!).

The percentage conversion helpers in SVGLengthContext used float
parameters, truncating intermediate results and producing rounding
errors visible through JavaScript APIs (e.g. 30% of 400px returning
120.00000762939453 instead of 120).

Widen convertValueFromPercentageToUserUnits from float to double so
divisions and multiplications stay in double precision. Callers
narrow back to float at the boundary.

Test: 
imported/w3c/web-platform-tests/svg/geometry/svg-length-convert-to-percentage-precision.html

* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-baseval-in-display-none.html:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-baseval-in-display-none-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-length-convert-to-percentage-precision.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-length-convert-to-percentage-precision-expected.txt:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/image-with-transform-clip-filter-expected.txt:
 Removed.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/filters/feImage-preserveAspectRatio-all-expected.txt:
 Removed.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/filters/feImage-preserveAspectratio-expected.txt:
 Removed.
* 
LayoutTests/platform/mac/svg/custom/image-with-transform-clip-filter-expected.png:
* LayoutTests/platform/mac/svg/filters/feImage-preserveAspectratio-expected.png:
* 
LayoutTests/platform/win/svg/custom/image-with-transform-clip-filter-expected.txt:
 Removed.
* LayoutTests/svg/custom/image-with-transform-clip-filter-expected.txt: 
Rebaselined.
* LayoutTests/svg/filters/feImage-preserveAspectRatio-all-expected.txt: 
Rebaselined.
* LayoutTests/svg/filters/feImage-preserveAspectratio-expected.txt: Rebaselined.
* Source/WebCore/svg/SVGLengthContext.h:
* Source/WebCore/svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage):
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
* Source/WebCore/svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsPercentage): Added FIXME.

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



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

Reply via email to