Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b25c0638104cc733d4619ea7bfe3d7e1b9cfde78
      
https://github.com/WebKit/WebKit/commit/b25c0638104cc733d4619ea7bfe3d7e1b9cfde78
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    A 
LayoutTests/fast/overflow/line-clamp-multiline-with-inline-flex-on-clamped-line-expected.html
    A 
LayoutTests/fast/overflow/line-clamp-multiline-with-inline-flex-on-clamped-line.html
    A 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-as-only-content-on-clamped-line-expected.html
    A 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-as-only-content-on-clamped-line.html
    A 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-on-clamped-line-expected.html
    A LayoutTests/fast/overflow/line-clamp-with-inline-flex-on-clamped-line.html
    M Source/WebCore/rendering/LineClampUpdater.h
    M Source/WebCore/rendering/RenderFlexibleBox.cpp

  Log Message:
  -----------
  Overlapping text in Activity panel in Slack web app
https://bugs.webkit.org/show_bug.cgi?id=315761
rdar://178051915

Reviewed by Simon Fraser.

    <div style="display: -webkit-box; -webkit-box-orient: vertical; 
-webkit-line-clamp: 1; overflow: hidden">
      visible
      <br>
      hidden<div style="display: inline-flex">hidden nested</div>
    </div>

The container should be one line tall. Instead it was two lines tall, with the
inline-flex and its surrounding text both showing through past the clamp point.

When an inline-flex sits on the line that should be clamped, the flex item's
inner block flow inherits the outer container's legacy line-clamp state and
claims the clamp position for itself (currentLineCount == maximumLineCount).
The outer block then early-exits because clampedRenderer is already set, so
the container's height is computed from the inner block's position deep inside
the atomic inline rather than from the outer block where the visible last line
actually lives.

Apply LineClampUpdater (the existing line-clamp scope mechanism used by
RenderBlockFlow::layoutBlock) to RenderFlexibleBox::layoutBlock too, and
broaden the isolate predicate from "display == InlineFlowRoot" to
"isNonReplacedAtomicInlineLevelBox()" so the flex container's interior is
excluded from outer line counting.

* 
LayoutTests/fast/overflow/line-clamp-multiline-with-inline-flex-on-clamped-line-expected.html:
 Added.
* 
LayoutTests/fast/overflow/line-clamp-multiline-with-inline-flex-on-clamped-line.html:
 Added.
* 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-as-only-content-on-clamped-line-expected.html:
 Added.
* 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-as-only-content-on-clamped-line.html:
 Added.
* 
LayoutTests/fast/overflow/line-clamp-with-inline-flex-on-clamped-line-expected.html:
 Added.
* LayoutTests/fast/overflow/line-clamp-with-inline-flex-on-clamped-line.html: 
Added.
* Source/WebCore/rendering/LineClampUpdater.h: .
(WebCore::LineClampUpdater::LineClampUpdater):
(WebCore::LineClampUpdater::~LineClampUpdater):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):

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



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

Reply via email to