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

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-dynamic-change-after-clean-content-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-dynamic-change-after-clean-content.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/reference/line-clamp-dynamic-change-after-clean-content-ref.html
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  [line-clamp] Content before the clamp point that does not change loses its 
lines
https://bugs.webkit.org/show_bug.cgi?id=326909
<rdar://problem/189569400>

Reviewed by Antti Koivisto.

<div style="line-clamp: 1"><p>Line 1</p><p id="after">Line 2</p></div>
<script>document.body.offsetHeight; after.textContent = "Line 2 
changed";</script>

"Line 2 changed" should stay after the clamp point. Content takes its lines off 
the line-clamp budget as it gets laid
out, but the first paragraph does not need layout after the change, so it gets 
skipped and its line never comes off the
budget: the second paragraph then fits within the budget and shows up with the 
block ellipsis.
Now every block that is part of a line-clamp container's formatting context 
lays out all of its children.

Test: 
imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-dynamic-change-after-clean-content.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-dynamic-change-after-clean-content-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/line-clamp-dynamic-change-after-clean-content.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/reference/line-clamp-dynamic-change-after-clean-content-ref.html:
 Added.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutInFlowChildren):

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



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

Reply via email to