Bug 240509

Summary: Incorrect line breaking for Javanese
Product: WebKit Reporter: Norbert Lindenberg <webkitbugs>
Component: Layout and RenderingAssignee: Myles C. Maxfield <mmaxfield>
Status: NEW ---    
Severity: Normal CC: bfulgham, mmaxfield, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
Attachments:
Description Flags
Screenshot 1
none
Screenshot 2
none
Screenshot 3 none

Description Norbert Lindenberg 2022-05-16 23:27:49 PDT
https://lindenbergsoftware.com/apple/safari/javanese-lb.html
contains a <p> element with style="overflow-wrap: break-word".

According to https://drafts.csswg.org/css-text/#overflow-wrap-property, this enables line breaks "at an arbitrary point if there are no otherwise-acceptable break points in the line", under the constraint that "grapheme clusters must stay together as one unit". (With 

https://drafts.csswg.org/css-text/#character makes clear that "A UA must use the extended grapheme cluster (not legacy grapheme cluster), as defined in UAX29, as the basis for its typographic character unit" but may tailor it where necessary to improve behavior.

The actual line breaking for Javanese with this setting shows several issues, that can be seen by resizing the window and thus the paragraph.

Screenshot 1 shows that a dependent vowel, U+A9B4 ◌ꦴ, is separated from the other characters of the extended grapheme cluster ꦪꦺꦴ it belongs to.

Screenshot 2 shows that an extended grapheme cluster ꦪꦺꦴ is not separated from the preceding extended grapheme cluster ꦤ꧀ꦲꦁ even though it clearly does not fit on the line.

Screenshot 3 shows that similarly several other extended grapheme clusters are allowed to stay on lines that they don't fit into: ꦧ꧀, ꦤ꧀ꦤꦺ, ꦤ꧀.
Comment 1 Norbert Lindenberg 2022-05-16 23:28:29 PDT
Created attachment 459483 [details]
Screenshot 1
Comment 2 Norbert Lindenberg 2022-05-16 23:29:29 PDT
Created attachment 459484 [details]
Screenshot 2
Comment 3 Norbert Lindenberg 2022-05-16 23:30:13 PDT
Created attachment 459485 [details]
Screenshot 3
Comment 4 Radar WebKit Bug Importer 2022-05-23 23:28:13 PDT
<rdar://problem/93810908>