Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: daecd76b2488ef4eb8c5bae3ff9a639db1d6da5d
      
https://github.com/WebKit/WebKit/commit/daecd76b2488ef4eb8c5bae3ff9a639db1d6da5d
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    A 
LayoutTests/fast/text/line-start-prohibition-consumes-entire-text-item-expected.txt
    A 
LayoutTests/fast/text/line-start-prohibition-consumes-entire-text-item.html
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp

  Log Message:
  -----------
  Assert in processLineBreakingResult when line-start-prohibited character 
consumes entire text item
https://bugs.webkit.org/show_bug.cgi?id=313379

Reviewed by Antti Koivisto.

  <div><a style="word-break: break-all">X&#x3001;</a> </div>

When content like "X," is too wide for 'width: 0px' line,
line breaker tries to keep at least the first character ("X") on the line.
The ideographic comma (U+3001) can't start a line (it's a
"line-start-prohibited" character), so the breaker pulls it in
with the "X", making the break unit "X," - the entire content.

Assert fires because we assume that when we intend to keep only the first 
character on the line,
we must have a partial content (break the content somewhere in the middle).
However when we have to pull in characters (see above) we may actually
pull in the entire content and we don't have to 'break' anymore (break 
transforms into keep).

Note: the diff looks larger than the actual change because the
trailingRunIndex lambda moved out of the if block (it was
previously only reachable for single-character items, now it's
shared with the line-start-prohibition case too). The actual
fix is just a extra check when pulling in trailing character(s):

* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::processOverflowingContent):

Canonical link: https://commits.webkit.org/312130@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to