Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cffc7df0742cbdcd6c2c3a816f8f4c8392feb2d2
https://github.com/WebKit/WebKit/commit/cffc7df0742cbdcd6c2c3a816f8f4c8392feb2d2
Author: Ahmad Saleem <[email protected]>
Date: 2026-06-16 (Tue, 16 Jun 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getrotationofchar-expected.txt
M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
Log Message:
-----------
[SVG] getRotationOfChar() returns ~360 instead of 0 for a full-turn rotate
https://bugs.webkit.org/show_bug.cgi?id=315193
rdar://178044934
Reviewed by Simon Fraser.
A per-character rotation that is an exact multiple of a full turn (e.g.
rotate="360") was applied verbatim when building the glyph fragment
transform. rotate(360) builds its matrix from sin(2*pi), which evaluates to
a machine-epsilon-sized non-zero value (~-2.4e-16) rather than 0, so the
angle extracted by SVGTextQuery::rotationOfCharacter() via atan2() came back
as a tiny negative number instead of 0.
SVGTextContentElement.getRotationOfChar()
therefore reported essentially 0-but-just-below, which normalizes to ~360.
Reduce the supplemental rotation modulo a full turn so an exact multiple of
360 collapses to the identity transform, yielding exactly 0. Values that are
not multiples of 360 (e.g. 365, -10, 180.5) are numerically unchanged.
*
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getrotationofchar-expected.txt:
Progression
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
Canonical link: https://commits.webkit.org/315293@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications