Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c9bdb3e40b480cc04d479ddbbf9b35f8944d9d9d
      
https://github.com/WebKit/WebKit/commit/c9bdb3e40b480cc04d479ddbbf9b35f8944d9d9d
  Author: Alan Baradlay <[email protected]>
  Date:   2026-01-18 (Sun, 18 Jan 2026)

  Changed paths:
    A 
LayoutTests/fast/inline/revert-line-to-overflowing-content-assert-expected.txt
    A LayoutTests/fast/inline/revert-line-to-overflowing-content-assert.html
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp

  Log Message:
  -----------
  [block-in-inline] ASSERT in RenderTreeNeedsLayoutChecker when re-building the 
current line
https://bugs.webkit.org/show_bug.cgi?id=305702
<rdar://166972460>

Reviewed by Antti Koivisto.

When a line needs to roll back to the previous wrapping opportunity,
we rebuild it by starting a new line and re-adding inline content until the 
wrapping point is reached, rather than trimming trailing content (see 
rebuildLineWithInlineContent).

This patch addresses the case where the last wrapping opportunity is the 
special m_partialLeadingTextItem.
As the name suggests, this represents a partial leading item on the line:
it contains the right portion of an inline item whose left portion is on the 
previous line (e.g. when overflowing text is split).

rebuildLineWithInlineContent previously failed to handle this case and would 
incorrectly commit inline items up to the end of the needsLayout range
(see the for (; endOfCandidateContent < layoutRange.endIndex(); 
++endOfCandidateContent) loop).

Test: fast/inline/revert-line-to-overflowing-content-assert.html

* 
LayoutTests/fast/inline/revert-line-to-overflowing-content-assert-expected.txt: 
Added.
* LayoutTests/fast/inline/revert-line-to-overflowing-content-assert.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::rebuildLineWithInlineContent):

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



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

Reply via email to