Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7c4cdd40963bfc1179b43e178a58277afbfb9be0
https://github.com/WebKit/WebKit/commit/7c4cdd40963bfc1179b43e178a58277afbfb9be0
Author: Ahmad Saleem <[email protected]>
Date: 2026-06-12 (Fri, 12 Jun 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getrotationofchar-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getstartpositionofchar-expected.txt
M Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
Log Message:
-----------
[SVG] text-orientation does not affect glyph orientation in SVG <text>
https://bugs.webkit.org/show_bug.cgi?id=315190
rdar://178044217
Reviewed by Nikolas Zimmermann.
SVG <text> ignored the CSS 'text-orientation' property when computing the
per-glyph rotation in vertical writing modes. The value is parsed, computed
and inherited like any other property, but SVGTextLayoutEngineBaseline only
ever consulted the deprecated 'glyph-orientation-vertical' property, so
'mixed' / 'upright' / 'sideways' had no effect on the rendered glyphs or on
SVGTextContentElement.getRotationOfChar().
In addition, the sideways-rl / sideways-lr writing modes did not typeset
glyphs sideways: they fell through to the per-character UAX#50 path instead
of rotating every glyph a quarter turn toward the block direction.
This patch makes calculateGlyphOrientationAngle() honor the writing mode and
'text-orientation' per SVG2 / CSS Writing Modes 3:
- sideways-rl / sideways-lr: every glyph is rotated a quarter turn
(clockwise for sideways-rl, counter-clockwise for sideways-lr),
independent of 'text-orientation' and the character's intrinsic vertical
orientation. The counter-clockwise case returns 270deg so the existing
advance/orientation-shift handling applies; getRotationOfChar() reports it
as -90 via the atan2-based extraction.
- vertical-rl / vertical-lr: 'text-orientation' determines the orientation
(upright -> 0deg, sideways -> 90deg). The initial 'mixed' value falls back
to 'glyph-orientation-vertical', preserving the legacy property when
'text-orientation' is unset.
*
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getrotationofchar-expected.txt:
Progressions
*
LayoutTests/imported/w3c/web-platform-tests/svg/text/scripted/getstartpositionofchar-expected.txt:
Rebaseline
* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
Canonical link: https://commits.webkit.org/315080@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications