Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 58c53af50a29cac771a859c18c27036fc3696335
https://github.com/WebKit/WebKit/commit/58c53af50a29cac771a859c18c27036fc3696335
Author: Ahmad Saleem <[email protected]>
Date: 2025-12-17 (Wed, 17 Dec 2025)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt
R
LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt
R
LayoutTests/platform/ios/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt
M Source/WebCore/svg/SVGLength.cpp
Log Message:
-----------
SVGLength.value doesn't update when writing-mode changes for font-relative
units
https://bugs.webkit.org/show_bug.cgi?id=303897
rdar://166190252
Reviewed by Vitor Roriz.
When accessing SVGLength.value after changing style attributes like
writing-mode, font-relative units (ch, em, rem, ex) were using stale
computed styles. This caused incorrect values for units like 'ch' which
depend on font metrics that vary with writing mode.
The fix ensures style is recalculated before resolving length values,
so font metrics reflect the current computed style.
This is performance neutral on Speedometer and MotionMark. Please refer
to performance testing on radar (Thanks to Taher for help). Additionally,
this also adds `if` conditions to only update stlye when we have length
type, which are relative [e.g., ch] (once again Thanks to Taher for help).
It does so by leveraging lambda which uses switch to list out absolute
units - which at least supported in enum `SVGLengthType` and as per CSS
specification (1-1).
*
LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt:
Progression
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt:
Removed.
*
LayoutTests/platform/ios/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt:
Removed.
* Source/WebCore/svg/SVGLength.cpp:
(WebCore::SVGLength::valueForBindings):
Canonical link: https://commits.webkit.org/304657@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications