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

  Changed paths:
    M Source/WebCore/Sources.txt
    A Source/WebCore/rendering/LegacyLineClampUpdater.cpp
    A Source/WebCore/rendering/LegacyLineClampUpdater.h
    M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
    M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h

  Log Message:
  -----------
  [cleanup] Move the legacy line-clamp logic out of RenderDeprecatedFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=326691
<rdar://problem/189425012>

Reviewed by Antti Koivisto.

-webkit-line-clamp is driven by RenderDeprecatedFlexibleBox: it sets up the 
legacy line-clamp budget, lays out its
children, re-lays out the block with the last formatted line when that line got 
an ellipsis, and reads back where the
content got clamped. None of this is flexbox specific.
Move it to LegacyLineClampUpdater, so that a regular block container can drive 
-webkit-line-clamp the same way.
RenderDeprecatedFlexibleBox only lays out its children while the updater is in 
scope.

No change in functionality.

* Source/WebCore/Sources.txt:
* Source/WebCore/rendering/LegacyLineClampUpdater.cpp: Added.
(WebCore::LegacyLineClampUpdater::LegacyLineClampUpdater):
(WebCore::LegacyLineClampUpdater::~LegacyLineClampUpdater):
(WebCore::blockContainerForLastFormattedLine): Moved from 
RenderDeprecatedFlexibleBox.cpp.
(WebCore::LegacyLineClampUpdater::clampedContent):
* Source/WebCore/rendering/LegacyLineClampUpdater.h: Added.
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutSingleClampedFlexItem):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::blockContainerForLastFormattedLine): Deleted.
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h:

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



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

Reply via email to