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

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-floats-008.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-floats-011.html
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/rendering/LineClampUpdater.cpp
    M Source/WebCore/rendering/LineClampUpdater.h
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderLayer.cpp

  Log Message:
  -----------
  [line-clamp] Floats paint past the block-end content edge of the line-clamp 
container
https://bugs.webkit.org/show_bug.cgi?id=327039
<rdar://problem/189653161>

Reviewed by Antti Koivisto.

<div style="line-clamp: 2"><div style="float: left; width: 10px; height: 200px; 
background: green"></div>Line 1<br>Line 2<br>Line 3</div>

The float paints all the way down to its bottom, past the line-clamp container.
"Within a line-clamp container, floats which have not been made into invisible 
boxes must be visually clipped to the
unshaped block-end content edge of the line-clamp container."
https://drafts.csswg.org/css-overflow-4/#line-clamp-containers

Now layout marks the visible floats of a line-clamp container as clipped (where 
it already decides whether they are invisible
boxes), and they get clipped to the container's block-end content edge (and 
nowhere else): floats without a layer
when the block that paints them paints them, floats with a layer (and the 
layers inside them) through the layer clip rects,
in the space of the float's parent so that a transform on the float does not 
move the clip.

line-clamp-with-floats-008 and -011 match their reference except for the 
gradient they paint the green square with
(the same plain linear-gradient square without line-clamp has the same 
difference), so they get fuzzy matching.

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-floats-008.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-with-floats-011.html:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateRenderTreePositions):
* Source/WebCore/rendering/LineClampUpdater.cpp:
(WebCore::LineClampUpdater::isInsideLineClampContainer):
(WebCore::LineClampUpdater::blockEndClipRect):
* Source/WebCore/rendering/LineClampUpdater.h:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::paintFloats):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::backgroundClipRect const):

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



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

Reply via email to