Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d0037baf724076591471b689f2fe0636fa11aa9
      
https://github.com/WebKit/WebKit/commit/6d0037baf724076591471b689f2fe0636fa11aa9
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-18 (Tue, 18 Aug 2026)

  Changed paths:
    M LayoutTests/fast/overflow/line-clamp-on-last-formatted-line-expected.html
    M LayoutTests/fast/overflow/line-clamp-on-last-formatted-line.html
    A LayoutTests/fast/overflow/line-clamp-with-block-in-inline-expected.html
    A LayoutTests/fast/overflow/line-clamp-with-block-in-inline.html
    M Source/WebCore/layout/integration/inline/InlineIteratorLineBox.h
    M Source/WebCore/layout/integration/inline/InlineIteratorLineBoxLegacyPath.h
    M Source/WebCore/layout/integration/inline/InlineIteratorLineBoxModernPath.h
    M Source/WebCore/rendering/LineClampUpdater.h
    M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

  Log Message:
  -----------
  REGRESSION(303972@main) [block-in-inline] Unexpected ellipsis shows up when 
line-clamp is applied
https://bugs.webkit.org/show_bug.cgi?id=319285
<rdar://problem/182123153>

Reviewed by Antti Koivisto.

  <div style="display: -webkit-box; -webkit-box-orient: vertical; 
-webkit-line-clamp: 1">
    <span><div>PASS if no ellipsis</div></span>
  </div>

There is one line and room for one line, so nothing is clamped and no ellipsis
should show. Instead it was "PASS if no ellipsis...".

Inline layout puts the ellipsis on as soon as a line reaches the clamp limit,
because clamping is shared across sibling formatting contexts and none of them
can tell whether more content follows. The deprecated flexbox takes it back off
afterwards by relaying out the block container that holds the last formatted 
line
with no clamping, and blockContainerForLastFormattedLine looked for that 
container
by walking block level children. With block-in-inline the block sits inside the
inline box, so the walk stepped right past it and found nothing.

Ask the lines instead of the render tree. A block container with inline children
knows from its own display lines whether the last formatted line is one of its 
own
or belongs to a block level box sitting on one of them, and recursing into that 
box
asks the same question one level down.

Off the render tree the walk no longer reaches floats, which is what used to 
take the
ellipsis back off a float by accident. Floating and out-of-flow boxes never 
count
towards the clamp (see updateLineClampStateAndLogicalHeightAfterLayout), so 
neither
should be ellipsized by one, and LineClampUpdater now clears the clamp for them 
the
way it already does for atomic inline level boxes.

The second case in line-clamp-on-last-formatted-line.html expected an ellipsis 
on a
line holding an inline-block with nothing after it. There is no clamp point 
after the
last line box there, so no ellipsis is correct (css-overflow-4 max-lines) 
-WebKit now matches Blink here.

* Source/WebCore/layout/integration/inline/InlineIteratorLineBox.h:
(WebCore::InlineIterator::LineBox::hasContentfulInFlowBox const):
* Source/WebCore/layout/integration/inline/InlineIteratorLineBoxLegacyPath.h:
* Source/WebCore/layout/integration/inline/InlineIteratorLineBoxModernPath.h:
* Source/WebCore/rendering/LineClampUpdater.h:
(WebCore::LineClampUpdater::LineClampUpdater):
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::blockContainerForLastFormattedLine):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* LayoutTests/fast/overflow/line-clamp-on-last-formatted-line.html:
* LayoutTests/fast/overflow/line-clamp-on-last-formatted-line-expected.html:
* LayoutTests/fast/overflow/line-clamp-with-block-in-inline.html: Added.
* LayoutTests/fast/overflow/line-clamp-with-block-in-inline-expected.html: 
Added.

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



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

Reply via email to