Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4c22d3192a194f0a17bcb35996864803f9e5dcef
      
https://github.com/WebKit/WebKit/commit/4c22d3192a194f0a17bcb35996864803f9e5dcef
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-04-24 (Fri, 24 Apr 2026)

  Changed paths:
    A LayoutTests/svg/text/glyph-orientation-vertical-auto-utr50-expected.txt
    A LayoutTests/svg/text/glyph-orientation-vertical-auto-utr50.html
    M Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp

  Log Message:
  -----------
  Use UTR#50 Vertical_Orientation for SVG glyph-orientation-vertical: auto
https://bugs.webkit.org/show_bug.cgi?id=312665
rdar://175064567

Reviewed by Nikolas Zimmermann.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

SVG 2 obsoletes glyph-orientation-vertical and defines that 'auto'
must alias to text-orientation: mixed [1], which uses UTR#50 [2] to
determine whether a character is rendered upright or sideways in
vertical text [3].

Our implementation used East Asian Width (UCHAR_EAST_ASIAN_WIDTH) to
determine orientation, which incorrectly treated all EAW=Ambiguous
characters as upright. This caused characters like U+00B0 DEGREE SIGN,
U+2014 EM DASH, and U+2026 HORIZONTAL ELLIPSIS to render upright when
they should be sideways per UTR#50.

Replace the East Asian Width switch with UCHAR_VERTICAL_ORIENTATION
from ICU, mapping U_VO_UPRIGHT and U_VO_TRANSFORMED_UPRIGHT to 0
degrees, and U_VO_ROTATED and U_VO_TRANSFORMED_ROTATED to 90 degrees.

Inspired by a similar fix in Blink:
https://chromium.googlesource.com/chromium/src.git/+/2754c16948f97fcf655d5f23613468fcd63ccb76

[1] 
https://w3c.github.io/svgwg/svg2-draft/text.html#GlyphOrientationVerticalProperty
[2] http://www.unicode.org/reports/tr50/
[3] https://drafts.csswg.org/css-writing-modes-3/#glyph-orientation

* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):

> This test is not WPT since other browsers don't support 
> (glyph-vertical-orientation):
* LayoutTests/svg/text/glyph-orientation-vertical-auto-utr50.html
* LayoutTests/svg/text/glyph-orientation-vertical-auto-utr50-expected.txt

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



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

Reply via email to