Skip to content

Commit

Permalink
ASSERTION FAILED: lineEndingEllipsisPolicy != LineEndingEllipsisPolic…
Browse files Browse the repository at this point in the history
…y::WhenContentOverflowsInInlineDirection || truncateRight.has_value() || right(boxes.last()) == visualRightForContentEnd /app/webkit/Source/WebCore/layout/formattingContexts/inline/displ

https://bugs.webkit.org/show_bug.cgi?id=262262
<rdar://problem/116503519>

Reviewed by Antti Koivisto.

Zero width content should never need ellipsis.

* LayoutTests/fast/text/overflow-ellipsis-on-empty-content-expected.txt: Added.
* LayoutTests/fast/text/overflow-ellipsis-on-empty-content.html: Added.
* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::InlineDisplayLineBuilder::trailingEllipsisVisualRectAfterTruncation):

Canonical link: https://commits.webkit.org/276089@main
  • Loading branch information
alanbaradlay committed Mar 14, 2024
1 parent 51ae1a6 commit f7185dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PASS if no assert in debug.

16 changes: 16 additions & 0 deletions LayoutTests/fast/text/overflow-ellipsis-on-empty-content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<style>
.outer {
width: 100px;
text-indent: 101px hanging;
}
.inner {
text-overflow: ellipsis;
overflow: hidden;
}
</style>
PASS if no assert in debug.
<div class=outer><div class=inner><span><div></div></span></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ std::optional<FloatRect> InlineDisplayLineBuilder::trailingEllipsisVisualRectAft
case LineEndingEllipsisPolicy::NoEllipsis:
return false;
case LineEndingEllipsisPolicy::WhenContentOverflowsInInlineDirection:
return displayLine.contentLogicalWidth() > displayLine.lineBoxLogicalRect().width();
return displayLine.contentLogicalWidth() && displayLine.contentLogicalWidth() > displayLine.lineBoxLogicalRect().width();
case LineEndingEllipsisPolicy::WhenContentOverflowsInBlockDirection:
if (isLastLineWithInlineContent)
return false;
Expand Down

0 comments on commit f7185dc

Please sign in to comment.