Bug 240279 - Traditional Mongolian script characters incorrectly oriented
Summary: Traditional Mongolian script characters incorrectly oriented
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 212128 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-05-10 08:38 PDT by r12a
Modified: 2023-12-22 10:28 PST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description r12a 2022-05-10 08:38:43 PDT
Lines of text in the Traditional Mongolian script run vertically from top to bottom of the page. Lines flow from left to right. The script is cursive, meaning that the characters join along the vertical centre line. Here is an example:

https://user-images.githubusercontent.com/4839211/167632640-cb805b08-59a1-4c73-a28f-b47f7048f153.png

Note the orientation of the glyphs.


Specs:
css-writing-modes-4 provides the writing-modes property. The vertical-lr value is designed to display Traditional Mongolian text as expected.


Tests & results:
i18n test suite, Vertical text, Vertical-LR, Glyphs (https://w3c.github.io/i18n-tests/results/writing-mode-vertical#lr_glyphs)

Results

    Gecko: ✅ Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0

    Blink: ✅ Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36

    WebKit: ❌ Rotates lines appropriately, but doesn't display characters in the correct orientation and doesn't join them up (see the left-hand line below). Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15

    https://user-images.githubusercontent.com/4839211/105961907-09663500-6077-11eb-9034-13afb495de68.png

    To get this to work in WebKit you need to add text-orientation: sideways to the CSS, which should not be necessary, and is not needed for Gecko and Blink browsers.


This issue is being tracked by the W3C at https://w3c.github.io/mlreq/gap-analysis/#issue39_vertical_text

Another (long) bug was raised in 2013 and ground to a halt in 2014 (8 years ago!).  I'm starting a new bug because i want to just focus on making Mongolian look correct and getting WebKit to be interoperable with other browsers from a content author perspective. (See https://bugs.webkit.org/show_bug.cgi?id=112488)
Comment 1 Myles C. Maxfield 2022-05-10 10:10:16 PDT
This has the same root cause as https://bugs.webkit.org/show_bug.cgi?id=212128
Comment 2 Radar WebKit Bug Importer 2022-05-17 08:39:11 PDT
<rdar://problem/93426525>
Comment 3 Brent Fulgham 2022-06-30 13:29:59 PDT
Marking as Dupe of Bug 212128 to match Radar state.

*** This bug has been marked as a duplicate of bug 212128 ***
Comment 4 r12a 2022-07-01 01:42:14 PDT
I had checked bug 212128 before raising this, and concluded that bug 212128 may involve a fix for a small problem that is not necessarily the fix needed for this much more generalised problem. Certainly, for CJK, rotation of punctuation is handled independently from correctly rotating ordinary text. It may be that Mongolian is a special case, but then i still think that bug 212128 should be rather classed as superceded by this issue, and some text should be added to the bug report to indicate that this is a much bigger problem than just fixing parentheses and brackets.
Comment 5 Myles C. Maxfield 2022-07-05 21:38:21 PDT
I think we would probably fix all of these bugs in a single patch (or single patch series).

Under the assumption that we probably only need a single bug to track these incorrectly rotated characters, do you think we should reverse the duping relationship and dup that bug to this one instead?
Comment 6 r12a 2022-07-05 21:41:05 PDT
Yeah, that's what i was thinking, since it seems to be a superset that includes the other bug.  I agree that it would seem to make sense to fix all in a single patch.
Comment 7 Myles C. Maxfield 2022-07-05 23:16:07 PDT
Reversing dup direction.
Comment 8 Myles C. Maxfield 2022-07-05 23:16:39 PDT
*** Bug 212128 has been marked as a duplicate of this bug. ***
Comment 9 Ahmad Saleem 2023-11-06 13:48:40 PST
Blink merge: https://chromium.googlesource.com/chromium/blink/+/e3ba3532accd84e6a0253705595b97556ae7ca67

In my local testing by adding above in WebKit, it progress both test cases mentioned in Comment 0 and also one of WPT:

https://wpt.fyi/results/css/css-writing-modes/mongolian-orientation-002.html?label=master&label=experimental&aligned&q=Mongolian
Comment 10 Ahmad Saleem 2023-11-06 13:49:45 PST
(In reply to Ahmad Saleem from comment #9)
> Blink merge:
> https://chromium.googlesource.com/chromium/blink/+/
> e3ba3532accd84e6a0253705595b97556ae7ca67
> 
> In my local testing by adding above in WebKit, it progress both test cases
> mentioned in Comment 0 and also one of WPT:
> 
> https://wpt.fyi/results/css/css-writing-modes/mongolian-orientation-002.
> html?label=master&label=experimental&aligned&q=Mongolian

WebKit Source: https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/FontCascadeFonts.cpp#224

Line 235 & Line 270.
Comment 11 Ahmad Saleem 2023-11-06 13:52:03 PST
(In reply to Ahmad Saleem from comment #10)
> (In reply to Ahmad Saleem from comment #9)
> > Blink merge:
> > https://chromium.googlesource.com/chromium/blink/+/
> > e3ba3532accd84e6a0253705595b97556ae7ca67
> > 
> > In my local testing by adding above in WebKit, it progress both test cases
> > mentioned in Comment 0 and also one of WPT:
> > 
> > https://wpt.fyi/results/css/css-writing-modes/mongolian-orientation-002.
> > html?label=master&label=experimental&aligned&q=Mongolian
> 
> WebKit Source:
> https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/
> FontCascadeFonts.cpp#224
> 
> Line 235 & Line 270.

Note - it fixes this as well from other bug: http://www.mongolfont.com/test/webkit/div.html
Comment 12 Ahmad Saleem 2023-11-08 16:16:10 PST
Attempt PR - https://github.com/WebKit/WebKit/pull/20195
Comment 13 EWS 2023-12-22 10:28:28 PST
Committed 272454@main (6c53862898c9): <https://commits.webkit.org/272454@main>

Reviewed commits have been landed. Closing PR #22186 and removing active labels.