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

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/block-ellipsis-036.html
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/LineLayoutResult.h

  Log Message:
  -----------
  [line-clamp] Keep nothing but the block ellipsis on a fully displaced line
https://bugs.webkit.org/show_bug.cgi?id=325336
<rdar://problem/188440163>

Reviewed by Antti Koivisto.

<div style="line-clamp: 2">first line <span style="font-size: 
2em">unbreakable_content</span> after</div>

When the block ellipsis displaces all the content of the clamped line, the 
inline box start (and any float or
out-of-flow box placed before the content) stayed on that line, and inline 
boxes made the line taller.
Now the line reverts to its start, so everything moves to the next line with 
the content, and only the root
inline box strut sizes the line (open inline boxes keep their fragment but 
don't stretch it).
https://drafts.csswg.org/css-overflow-4/#block-ellipsis

Test: 
fast/inline/line-clamp-fully-displaced-line-moves-inline-box-start-to-next-line.html

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/line-clamp/block-ellipsis-036.html:
 Tolerate the gradient's off-by-one green pixels.

* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp:
(WebCore::Layout::InlineFormattingUtils::inlineLevelBoxAffectsLineBox const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp:
(WebCore::Layout::LineBox::LineBox):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBox.h:
(WebCore::Layout::LineBox::hasBlockEllipsisContentOnly const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::LineBoxBuilder::buildForRootInlineBoxOnly):
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::processLineBreakingResult):
(WebCore::Layout::LineBuilder::unplaceFloatBox):
(WebCore::Layout::LineBuilder::rebuildLineWithInlineContent):
(WebCore::Layout::LineBuilder::revertLineToStart):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/LineLayoutResult.h:
(WebCore::Layout::LineLayoutResult::hasBlockEllipsisContentOnly const):

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



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

Reply via email to