Skip to content

Commit

Permalink
[IFC][line-clamp] imported/w3c/web-platform-tests/css/css-overflow/we…
Browse files Browse the repository at this point in the history
…bkit-line-clamp-025.html asserts

https://bugs.webkit.org/show_bug.cgi?id=256142

Reviewed by Antti Koivisto.

Adding the "epsilon wiggle room" (see 263428@main) causes assert when we have exact available space values. In such cases we don't find any overlapping display box even though we know the line content is overflowing (i.e. the last (first) display box must be overflowing).

* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::truncateOverflowingDisplayBoxes):

Canonical link: https://commits.webkit.org/263541@main
  • Loading branch information
alanbaradlay committed Apr 30, 2023
1 parent f5213fd commit e820cde
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -256,8 +256,8 @@ static float truncateOverflowingDisplayBoxes(const InlineDisplay::Line& displayL
}
isFirstContentRun = false;
}
ASSERT(truncateRight.has_value());
return truncateRight.value_or(0.f);
ASSERT(truncateRight.has_value() || right(boxes.last()) == visualRightForContentEnd);
return truncateRight.value_or(right(boxes.last()));
}

auto truncateLeft = std::optional<float> { };
Expand All @@ -276,8 +276,8 @@ static float truncateOverflowingDisplayBoxes(const InlineDisplay::Line& displayL
}
isFirstContentRun = false;
}
ASSERT(truncateLeft.has_value());
return truncateLeft.value_or(ellipsisWidth) - ellipsisWidth;
ASSERT(truncateLeft.has_value() || left(boxes.first()) == visualLeftForContentEnd);
return truncateLeft.value_or(left(boxes.first())) - ellipsisWidth;
}

std::optional<FloatRect> InlineDisplayLineBuilder::trailingEllipsisVisualRectAfterTruncation(LineEndingEllipsisPolicy lineEndingEllipsisPolicy, const InlineDisplay::Line& displayLine, InlineDisplay::Boxes& displayBoxes, bool isLastLineWithInlineContent)
Expand Down

0 comments on commit e820cde

Please sign in to comment.