[IFC][Integration] InlineIterator::Line functions should all return float values
https://bugs.webkit.org/show_bug.cgi?id=238106
Reviewed by Antti Koivisto.
Display structures are supposed to be all float based.
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::lineBoxHeight const):
(WebCore::InlineIterator::contentStartInBlockDirection):
(WebCore::InlineIterator::Line::contentLogicalTop const):
(WebCore::InlineIterator::Line::contentLogicalBottom const):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::Line::lineBoxTop const):
(WebCore::InlineIterator::Line::lineBoxBottom const):
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxTop const):
(WebCore::InlineIterator::LineIteratorLegacyPath::lineBoxBottom const):
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTop const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottom const):
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxTop const):
(WebCore::InlineIterator::LineIteratorModernPath::lineBoxBottom const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const):
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::physicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@291535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 3c031b3..03259ef 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -3067,7 +3067,7 @@
return top;
auto lastLineSelectionBottom = LineSelection::logicalBottom(*lastLine) + offsetToBlockBefore.height();
- top = std::max(top, lastLineSelectionBottom);
+ top = std::max(top, LayoutUnit { lastLineSelectionBottom });
}
return top;
}
@@ -3165,8 +3165,8 @@
// Now paint the gaps for the lines.
for (; line && hasSelectedChildren(line); line.traverseNext()) {
- auto selectionTop = LineSelection::logicalTopAdjustedForPrecedingBlock(*line);
- auto selectionHeight = std::max(0_lu, LineSelection::logicalBottom(*line) - selectionTop);
+ auto selectionTop = LayoutUnit { LineSelection::logicalTopAdjustedForPrecedingBlock(*line) };
+ auto selectionHeight = LayoutUnit { std::max(0.f, LineSelection::logicalBottom(*line) - selectionTop) };
if (!containsStart && !lastSelectedLine &&
selectionState() != HighlightState::Start && selectionState() != HighlightState::Both && !isRubyBase())
@@ -3188,7 +3188,7 @@
if (lastSelectedLine && selectionState() != HighlightState::End && selectionState() != HighlightState::Both) {
// Update our lastY to be the bottom of the last selected line.
- auto lastLineSelectionBottom = LineSelection::logicalBottom(*lastSelectedLine);
+ auto lastLineSelectionBottom = LayoutUnit { LineSelection::logicalBottom(*lastSelectedLine) };
lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + lastLineSelectionBottom;
lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, lastLineSelectionBottom, cache);
lastLogicalRight = logicalRightSelectionOffset(rootBlock, lastLineSelectionBottom, cache);
@@ -3421,7 +3421,7 @@
if (closestBox) {
if (moveCaretToBoundary) {
- LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->contentLogicalTopAdjustedForHitTesting(), LayoutUnit(firstLineWithChildren->contentLogicalTop()));
+ auto firstLineWithChildrenTop = LayoutUnit { std::min(firstLineWithChildren->contentLogicalTopAdjustedForHitTesting(), firstLineWithChildren->contentLogicalTop()) };
if (pointInLogicalContents.y() < firstLineWithChildrenTop
|| (blocksAreFlipped && pointInLogicalContents.y() == firstLineWithChildrenTop)) {
auto box = firstLineWithChildren->firstLeafBox();
@@ -3474,8 +3474,8 @@
auto line = box->line();
// FIXME: This is mixing physical and logical coordinates.
auto unflippedVisualRect = box->visualRectIgnoringBlockDirection();
- auto top = std::max(line->contentLogicalTop(), LayoutUnit { unflippedVisualRect.y() });
- auto bottom = std::min(line->contentLogicalBottom(), LayoutUnit { unflippedVisualRect.maxY() });
+ auto top = std::max(line->contentLogicalTop(), unflippedVisualRect.y());
+ auto bottom = std::min(line->contentLogicalBottom(), unflippedVisualRect.maxY());
auto rect = LayoutRect { LayoutUnit { additionalOffset.x() + unflippedVisualRect.x() }
, additionalOffset.y() + top
, LayoutUnit { unflippedVisualRect.width() }