Bug 228228

Summary: Inline element can trigger incorrect line break with word-break: break-all and white-space: pre-wrap
Product: WebKit Reporter: Ian Henderson <ian>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, fantasai.bugs, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Apple Silicon)   
OS: macOS 11   
Attachments:
Description Flags
test case none

Ian Henderson
Reported 2021-07-23 02:55:14 PDT
Created attachment 434077 [details] test case See attached test case. In Blink and Gecko, all three white-space settings produce the same result. In WebKit, the first setting (white-space: pre-wrap) produces a different layout when an inline element is added.
Attachments
test case (571 bytes, text/html)
2021-07-23 02:55 PDT, Ian Henderson
no flags
Sam Sneddon [:gsnedders]
Comment 1 2021-07-23 04:38:26 PDT
This only affects legacy layout; LFC works correctly.
alan
Comment 2 2021-07-23 06:42:10 PDT
It looks like we drop the word-break property for the rest of the content when we see an inline box (unless it is explicitly set on the content again e.g. <div style='white-space: pre-wrap'><b>asdf</b> <span style="word-break: break-all">alsdjfalk</span></div>)
Radar WebKit Bug Importer
Comment 3 2021-07-30 02:56:17 PDT
fantasai
Comment 4 2025-08-28 03:29:05 PDT
We're now using LFC for almost all text content, so it seems this issue is fixed? Please verify or reopen as necessary. :)
Note You need to log in before you can comment on or make changes to this bug.