WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
291495
Misses word-break opportunity and overflows
https://bugs.webkit.org/show_bug.cgi?id=291495
Summary
Misses word-break opportunity and overflows
Johannes Odland
Reported
2025-04-13 12:28:45 PDT
There's a small bug in how WebKit breaks overflowing content with inline boxes. The bug occurs when it can fit the content but not the end side padding and border of an inline box inside the available width. Expected behavior: It should break at an earlier point if possible, moving the remaining content, padding and border to a new line. Current behavior: WebKit breaks the line at a later point, making the border and padding overflowing its container. Reduced test case:
https://johannesodland.github.io/browserbugs/2025/safari-word-break-before-inline-box-end.html
processOverflowingContentWithText
Attachments
[fast-cq]Patch
(6.13 KB, patch)
2025-04-25 09:03 PDT
,
alan
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2025-04-13 13:36:59 PDT
Firefox Nightly 139 (20250413095036) and Chrome Canary 137.0.7123.0 (Official Build) canary (arm64) matches each other and split in two lines. While Safari 18.4 and WebKit ToT (
293648@main
) remain in one line.
Johannes Odland
Comment 2
2025-04-14 01:03:40 PDT
Here's my current understanding of the issue: In `InlineContentBreaker::processOverflowingContentWithText()` webkit notices that the InlineBoxEnd item will cause overflow, and stores the index of the inline box end as `overflowingRunIndex`. Later, it tries to run `InlineContentBreaker::tryBreakingPreviousNonOverflowingRuns()`. There it will try to break the previous text run, but the entire run fits. It then includes the trailing InlineBoxEnd, which overflows.
Johannes Odland
Comment 3
2025-04-14 03:17:35 PDT
Maybe the width of any trailing InlineBoxEnds should be subtracted from the available space before trying to break preceding text runs?
Radar WebKit Bug Importer
Comment 4
2025-04-20 12:29:17 PDT
<
rdar://problem/149651067
>
alan
Comment 5
2025-04-25 09:03:24 PDT
Created
attachment 475049
[details]
[fast-cq]Patch
EWS
Comment 6
2025-04-25 15:31:35 PDT
Committed
294132@main
(7953222aee54): <
https://commits.webkit.org/294132@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 475049
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug