Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96d84d561c571bc2caf657e79827b428d5b81a76
      
https://github.com/WebKit/WebKit/commit/96d84d561c571bc2caf657e79827b428d5b81a76
  Author: Alan Baradlay <[email protected]>
  Date:   2026-10-10 (Sat, 10 Oct 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  [line-clamp] Floats after the clamp point are still visible
https://bugs.webkit.org/show_bug.cgi?id=326923
<rdar://problem/189578173>

Reviewed by Antti Koivisto.

<div style="line-clamp: 1">Line 1<div style="float: left; width: 50px; height: 
50px; background-color: red"></div><div>Line 2</div></div>

The float after the clamp point should be hidden, but it still paints.
"Within a line-clamp container, the following boxes and line boxes become 
invisible boxes: Any in-flow or floating boxes
that follow the clamp point in the box tree."
https://drafts.csswg.org/css-overflow-4/#line-clamp-containers

Now a float that follows the clamp point is made an invisible box and is not 
laid out, like in-flow boxes after the
clamp point: block layout does not insert it into the floating objects, and 
line layout does not place the floats inline
layout discarded with the rest of the content after the clamp point (they used 
to end up at the top left corner).
Inline layout now hides the floats it discards (forced hidden by line-clamp), 
and line layout does not place hidden floats.
A float that was hidden is made visible again before inline layout, so it gets 
laid out, and is hidden again if inline
layout discards it again.

* LayoutTests/TestExpectations: line-clamp-with-floats-004 and 
line-clamp-auto-015 pass now.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::setIsForcedHiddenForDiscardedFloat):
(WebCore::Layout::InlineFormattingContext::resetBoxGeometriesForDiscardedContent):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateRenderTreePositions):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::markInlineContentDirtyForLayout):

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



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

Reply via email to