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

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/RenderBlock.cpp

  Log Message:
  -----------
  [line-clamp] A line-clamp container does not establish an independent 
formatting context
https://bugs.webkit.org/show_bug.cgi?id=326200
<rdar://problem/189090409>

Reviewed by Antti Koivisto.

<div style="line-clamp: auto; max-height: 160px; line-height: 32px"><div 
style="margin: 16px">Line 1<br>Line 2<br>Line 3<br>Line 4<br>Line 5</div></div>

The inner div's margins should stay inside the line-clamp container, so only 4 
lines fit. The container does
not establish an independent formatting context, so the margins collapse 
through it and 5 lines fit instead.
Per spec, a box with continue: discard (which is what line-clamp sets in 
WebKit) "must establish an independent
formatting context".
(https://drafts.csswg.org/css-overflow-4/#valdef-continue-discard)

* LayoutTests/TestExpectations: line-clamp-auto-028, -029, -030 and 
line-clamp-bfc pass now.
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::establishesIndependentFormattingContextIgnoringDisplayType
 const):

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



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

Reply via email to