Bug 265252

Summary: Text in flex items not breaking under specific conditions
Product: WebKit Reporter: Kevin Muncie <nivek2002>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, mmaxfield, nivek2002, pdr, sgill26, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Mac (Apple Silicon)   
OS: macOS 14   
Attachments:
Description Flags
Test HTML page showing bug and other permutation which do not exhibit bug
none
Screenshot showing issue across three browsers
none
Test reduction
none
Test reduction
none
[fast-cq]Patch none

Description Kevin Muncie 2023-11-22 08:59:41 PST
Created attachment 468729 [details]
Test HTML page showing bug and other permutation which do not exhibit bug

This is a very peculiar bug that only seems to be happening in Safari. It was discovered when trying to render Cambodian text in a flex child, though the bug exists even when displaying Roman scripts.

In a Flexbox child, with a text string containing no (U+0020) spaces, IF the text:

- contains an inline-block element
- has zero-width space (U+200B) characters between each word
- all elements are wrapped in span elements

A screenshot and example HTML document for testing is being attached.
Comment 1 Kevin Muncie 2023-11-22 09:00:11 PST
Created attachment 468730 [details]
Screenshot showing issue across three browsers
Comment 2 zalan 2023-11-25 19:11:15 PST
Created attachment 468755 [details]
Test reduction
Comment 3 Radar WebKit Bug Importer 2023-11-25 19:12:03 PST
<rdar://problem/118796634>
Comment 4 zalan 2023-11-25 19:19:40 PST
Created attachment 468756 [details]
Test reduction

and now with no flex.
Comment 5 zalan 2023-11-25 20:48:26 PST
Created attachment 468757 [details]
[fast-cq]Patch
Comment 6 zalan 2023-11-25 20:51:14 PST
Thank you for filing this issue! This is indeed a peculiar bug.
Comment 7 EWS 2023-11-26 09:42:58 PST
Committed 271122@main (073d84471418): <https://commits.webkit.org/271122@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 468757 [details].