Bug 248201

Summary: Strings are not wrapped at zero width spaces when "word-break: keep-all" is set
Product: WebKit Reporter: Mark Donnellon <mark+webkit>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, karlcow, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 16   
Hardware: Mac (Intel)   
OS: macOS 13   
URL: https://codesandbox.io/s/wrapping-japanese-with-zwsp-f1nuic?file=/index.html
Attachments:
Description Flags
[fast-cq]Patch
none
screen-shot of the test case with the patch applied none

Description Mark Donnellon 2022-11-21 19:10:37 PST
I expect zero width spaces to have the same effect as regular spaces regarding wrapping text. However, in Safari, lines are not broken at zero width spaces. This is different to Chrome and Firefox, which break lines on zero width spaces when wrapping. 

https://codesandbox.io/s/wrapping-japanese-with-zwsp-f1nuic?file=/index.html
Comment 1 Mark Donnellon 2022-11-21 19:13:44 PST
My use case for this functionality was to allow my japanese strings to indicate appropriate spots to break lines without creating space between characters.
Comment 2 zalan 2022-11-21 20:00:01 PST
Thank you for filing this bug report. It looks like zero-width space is not treated as a soft wrap opportunity when "word-break: keep-all" is set on the block container.
Comment 3 Radar WebKit Bug Importer 2022-11-21 20:00:25 PST
<rdar://problem/102593988>
Comment 4 zalan 2022-11-21 21:20:40 PST
Created attachment 463656 [details]
[fast-cq]Patch
Comment 5 zalan 2022-11-21 21:22:00 PST
Created attachment 463657 [details]
screen-shot of the test case with the patch applied
Comment 6 EWS 2022-11-22 06:58:06 PST
Committed 256937@main (d97fdbd62db3): <https://commits.webkit.org/256937@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463656 [details].
Comment 7 Mark Donnellon 2022-11-22 14:50:10 PST
Wow! I'm glad I could create a good bug report and it was addressed so quickly!
Comment 8 zalan 2022-11-22 14:56:35 PST
(In reply to Mark Donnellon from comment #7)
> Wow! I'm glad I could create a good bug report and it was addressed so
> quickly!
I wish all bug reports were like this :) Thanks again!