Diff
Modified: trunk/Source/WebCore/ChangeLog (291311 => 291312)
--- trunk/Source/WebCore/ChangeLog 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/ChangeLog 2022-03-15 21:17:33 UTC (rev 291312)
@@ -1,3 +1,56 @@
+2022-03-15 Alan Bujtas <[email protected]>
+
+ [IFC][Integration] Rename selection* to enclosing* in InlineIterator::Line
+ https://bugs.webkit.org/show_bug.cgi?id=237909
+
+ Reviewed by Antti Koivisto.
+
+ These functions return enclosing (line box and content) geometries which we happen to use to compute selection boundaries (among other things).
+
+ * editing/VisiblePosition.cpp:
+ (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::blockDirectionPointInLine const):
+ (WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const):
+ (WebCore::InlineIterator::Line::enclosingHeightAdjustedForPrecedingBlock const):
+ (WebCore::InlineIterator::Line::selectionTopAdjustedForPrecedingBlock const): Deleted.
+ (WebCore::InlineIterator::Line::selectionHeightAdjustedForPrecedingBlock const): Deleted.
+ * layout/integration/InlineIteratorLine.h:
+ (WebCore::InlineIterator::Line::enclosingTop const):
+ (WebCore::InlineIterator::Line::enclosingTopForHitTesting const):
+ (WebCore::InlineIterator::Line::enclosingBottom const):
+ (WebCore::InlineIterator::Line::enclosingHeight const):
+ (WebCore::InlineIterator::Line::enclosingLogicalRect const):
+ (WebCore::InlineIterator::Line::enclosingPhysicalRect const):
+ (WebCore::InlineIterator::Line::selectionTop const): Deleted.
+ (WebCore::InlineIterator::Line::selectionTopForHitTesting const): Deleted.
+ (WebCore::InlineIterator::Line::selectionBottom const): Deleted.
+ (WebCore::InlineIterator::Line::selectionHeight const): Deleted.
+ (WebCore::InlineIterator::Line::selectionLogicalRect const): Deleted.
+ (WebCore::InlineIterator::Line::selectionPhysicalRect const): Deleted.
+ * layout/integration/InlineIteratorTextBox.cpp:
+ (WebCore::InlineIterator::TextBox::selectionRect const):
+ * rendering/CaretRectComputation.cpp:
+ (WebCore::computeCaretRectForLinePosition):
+ * rendering/LegacyRootInlineBox.cpp:
+ (WebCore::LegacyRootInlineBox::selectionTopAdjustedForPrecedingBlock const):
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::adjustEnclosingTopForPrecedingBlock const):
+ (WebCore::RenderBlockFlow::inlineSelectionGaps):
+ (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
+ (WebCore::RenderBlockFlow::adjustSelectionTopForPrecedingBlock const): Deleted.
+ * rendering/RenderBlockFlow.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::collectSelectionGeometries):
+ * rendering/RenderLineBreak.cpp:
+ (WebCore::RenderLineBreak::collectSelectionGeometries):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::positionForPoint):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::positionForPoint):
+ * rendering/TextBoxPainter.cpp:
+ (WebCore::TextBoxPainter::paintBackground):
+
2022-03-15 Patrick Griffis <[email protected]>
Add initial implementation of Fetch Metadata
Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (291311 => 291312)
--- trunk/Source/WebCore/editing/VisiblePosition.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -669,7 +669,7 @@
return { };
auto line = run->line();
- return line->containingBlock().localToAbsoluteQuad(FloatRect { line->selectionPhysicalRect() }).boundingBox();
+ return line->containingBlock().localToAbsoluteQuad(FloatRect { line->enclosingPhysicalRect() }).boundingBox();
}
int VisiblePosition::lineDirectionPointForBlockDirectionNavigation() const
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp (291311 => 291312)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -159,17 +159,17 @@
int Line::blockDirectionPointInLine() const
{
- return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(top(), selectionTopForHitTesting()) : std::min(bottom(), selectionBottom());
+ return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(top(), enclosingTopForHitTesting()) : std::min(bottom(), enclosingBottom());
}
-LayoutUnit Line::selectionTopAdjustedForPrecedingBlock() const
+LayoutUnit Line::enclosingTopAdjustedForPrecedingBlock() const
{
- return containingBlock().adjustSelectionTopForPrecedingBlock(selectionTop());
+ return containingBlock().adjustEnclosingTopForPrecedingBlock(enclosingTop());
}
-LayoutUnit Line::selectionHeightAdjustedForPrecedingBlock() const
+LayoutUnit Line::enclosingHeightAdjustedForPrecedingBlock() const
{
- return std::max<LayoutUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock());
+ return std::max<LayoutUnit>(0, enclosingBottom() - enclosingTopAdjustedForPrecedingBlock());
}
RenderObject::HighlightState Line::selectionState() const
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (291311 => 291312)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-15 21:17:33 UTC (rev 291312)
@@ -58,16 +58,16 @@
LayoutUnit lineBoxBottom() const;
LayoutUnit lineBoxHeight() const { return lineBoxBottom() - lineBoxTop(); }
- LayoutUnit selectionTop() const;
- LayoutUnit selectionTopForHitTesting() const;
- LayoutUnit selectionBottom() const;
- LayoutUnit selectionHeight() const;
+ LayoutUnit enclosingTop() const;
+ LayoutUnit enclosingBottom() const;
+ LayoutUnit enclosingHeight() const;
- LayoutRect selectionLogicalRect() const;
- LayoutRect selectionPhysicalRect() const;
+ LayoutRect enclosingLogicalRect() const;
+ LayoutRect enclosingPhysicalRect() const;
- LayoutUnit selectionTopAdjustedForPrecedingBlock() const;
- LayoutUnit selectionHeightAdjustedForPrecedingBlock() const;
+ LayoutUnit enclosingTopForHitTesting() const;
+ LayoutUnit enclosingTopAdjustedForPrecedingBlock() const;
+ LayoutUnit enclosingHeightAdjustedForPrecedingBlock() const;
RenderObject::HighlightState selectionState() const;
@@ -159,30 +159,30 @@
});
}
-inline LayoutUnit Line::selectionTop() const
+inline LayoutUnit Line::enclosingTop() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.selectionTop();
+ return path.enclosingTop();
});
}
-inline LayoutUnit Line::selectionTopForHitTesting() const
+inline LayoutUnit Line::enclosingTopForHitTesting() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.selectionTopForHitTesting();
+ return path.enclosingTopForHitTesting();
});
}
-inline LayoutUnit Line::selectionBottom() const
+inline LayoutUnit Line::enclosingBottom() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.selectionBottom();
+ return path.enclosingBottom();
});
}
-inline LayoutUnit Line::selectionHeight() const
+inline LayoutUnit Line::enclosingHeight() const
{
- return selectionBottom() - selectionTop();
+ return enclosingBottom() - enclosingTop();
}
inline LayoutUnit Line::lineBoxTop() const
@@ -199,14 +199,14 @@
});
}
-inline LayoutRect Line::selectionLogicalRect() const
+inline LayoutRect Line::enclosingLogicalRect() const
{
- return { LayoutPoint { contentLogicalLeft(), selectionTop() }, LayoutPoint { contentLogicalRight(), selectionBottom() } };
+ return { LayoutPoint { contentLogicalLeft(), enclosingTop() }, LayoutPoint { contentLogicalRight(), enclosingBottom() } };
}
-inline LayoutRect Line::selectionPhysicalRect() const
+inline LayoutRect Line::enclosingPhysicalRect() const
{
- auto physicalRect = selectionLogicalRect();
+ auto physicalRect = enclosingLogicalRect();
if (!isHorizontal())
physicalRect = physicalRect.transposedRect();
containingBlock().flipForWritingMode(physicalRect);
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h (291311 => 291312)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-15 21:17:33 UTC (rev 291312)
@@ -45,9 +45,9 @@
LayoutUnit top() const { return m_rootInlineBox->lineTop(); }
LayoutUnit bottom() const { return m_rootInlineBox->lineBottom(); }
- LayoutUnit selectionTop() const { return m_rootInlineBox->selectionTop(); }
- LayoutUnit selectionTopForHitTesting() const { return m_rootInlineBox->selectionTop(LegacyRootInlineBox::ForHitTesting::Yes); }
- LayoutUnit selectionBottom() const { return m_rootInlineBox->selectionBottom(); }
+ LayoutUnit enclosingTop() const { return m_rootInlineBox->selectionTop(); }
+ LayoutUnit enclosingTopForHitTesting() const { return m_rootInlineBox->selectionTop(LegacyRootInlineBox::ForHitTesting::Yes); }
+ LayoutUnit enclosingBottom() const { return m_rootInlineBox->selectionBottom(); }
LayoutUnit lineBoxTop() const { return m_rootInlineBox->lineBoxTop(); }
LayoutUnit lineBoxBottom() const { return m_rootInlineBox->lineBoxBottom(); }
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h (291311 => 291312)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-15 21:17:33 UTC (rev 291312)
@@ -54,13 +54,13 @@
LayoutUnit lineBoxTop() const { return LayoutUnit::fromFloatRound(line().lineBoxTop()); }
LayoutUnit lineBoxBottom() const { return LayoutUnit::fromFloatRound(line().lineBoxBottom()); }
- LayoutUnit selectionTop() const { return !m_lineIndex ? top() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).selectionBottom(); }
+ LayoutUnit enclosingTop() const { return !m_lineIndex ? top() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).enclosingBottom(); }
// FIXME: Remove the containingBlock().borderAndPaddingBefore() offset after retiring legacy line layout. It also requires changes in RenderText::positionForPoint to find the first line with offset.
// - the "before" value is already factored in to the line offset
// - this logic negates the first line's natural offset (e.g. block has no border/padding but the first line has a computed offset).
- LayoutUnit selectionTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : selectionTop(); };
+ LayoutUnit enclosingTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : enclosingTop(); };
// FIXME: Implement or replace.
- LayoutUnit selectionBottom() const { return bottom(); }
+ LayoutUnit enclosingBottom() const { return bottom(); }
float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLogicalOffset(); }
float contentLogicalRight() const { return contentLogicalLeft() + line().contentLogicalWidth(); }
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp (291311 => 291312)
--- trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorTextBox.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -45,8 +45,8 @@
if (clampedStart >= clampedEnd && !(rangeStart == rangeEnd && rangeStart >= start() && rangeStart <= end()))
return { };
- auto selectionTop = line()->selectionTop();
- auto selectionHeight = line()->selectionHeight();
+ auto selectionTop = line()->enclosingTop();
+ auto selectionHeight = line()->enclosingHeight();
LayoutRect selectionRect { logicalLeft(), selectionTop, logicalWidth(), selectionHeight };
Modified: trunk/Source/WebCore/rendering/CaretRectComputation.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -112,7 +112,7 @@
static LayoutRect computeCaretRectForLinePosition(const InlineIterator::LineIterator& line, float logicalLeftPosition, CaretRectMode caretRectMode)
{
auto& containingBlock = line->containingBlock();
- auto lineSelectionRect = line->selectionLogicalRect();
+ auto lineSelectionRect = line->enclosingLogicalRect();
int height = lineSelectionRect.height();
int top = lineSelectionRect.y();
Modified: trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/LegacyRootInlineBox.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -533,7 +533,7 @@
LayoutUnit LegacyRootInlineBox::selectionTopAdjustedForPrecedingBlock() const
{
- return blockFlow().adjustSelectionTopForPrecedingBlock(selectionTop());
+ return blockFlow().adjustEnclosingTopForPrecedingBlock(selectionTop());
}
LayoutUnit LegacyRootInlineBox::selectionBottom() const
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -3014,7 +3014,7 @@
return LayoutUnit { style().overflowY() == Overflow::Visible ? lastBaseline : std::min(boxHeight, lastBaseline) };
}
-LayoutUnit RenderBlockFlow::adjustSelectionTopForPrecedingBlock(LayoutUnit top) const
+LayoutUnit RenderBlockFlow::adjustEnclosingTopForPrecedingBlock(LayoutUnit top) const
{
if (selectionState() != RenderObject::HighlightState::Inside && selectionState() != RenderObject::HighlightState::End)
return top;
@@ -3065,7 +3065,7 @@
if (lastLineSelectionState != RenderObject::HighlightState::Inside && lastLineSelectionState != RenderObject::HighlightState::Start)
return top;
- LayoutUnit lastLineSelectionBottom = lastLine->selectionBottom() + offsetToBlockBefore.height();
+ LayoutUnit lastLineSelectionBottom = lastLine->enclosingBottom() + offsetToBlockBefore.height();
top = std::max(top, lastLineSelectionBottom);
}
return top;
@@ -3151,8 +3151,8 @@
// Now paint the gaps for the lines.
for (; line && hasSelectedChildren(line); line.traverseNext()) {
- LayoutUnit selTop = line->selectionTopAdjustedForPrecedingBlock();
- LayoutUnit selHeight = line->selectionHeightAdjustedForPrecedingBlock();
+ LayoutUnit selTop = line->enclosingTopAdjustedForPrecedingBlock();
+ LayoutUnit selHeight = line->enclosingHeightAdjustedForPrecedingBlock();
if (!containsStart && !lastSelectedLine &&
selectionState() != HighlightState::Start && selectionState() != HighlightState::Both && !isRubyBase())
@@ -3174,9 +3174,9 @@
if (lastSelectedLine && selectionState() != HighlightState::End && selectionState() != HighlightState::Both) {
// Update our lastY to be the bottom of the last selected line.
- lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + lastSelectedLine->selectionBottom();
- lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, lastSelectedLine->selectionBottom(), cache);
- lastLogicalRight = logicalRightSelectionOffset(rootBlock, lastSelectedLine->selectionBottom(), cache);
+ lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + lastSelectedLine->enclosingBottom();
+ lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, lastSelectedLine->enclosingBottom(), cache);
+ lastLogicalRight = logicalRightSelectionOffset(rootBlock, lastSelectedLine->enclosingBottom(), cache);
}
return result;
}
@@ -3380,7 +3380,7 @@
lastLineWithChildren = line;
// check if this root line box is located at this y coordinate
- if (pointInLogicalContents.y() < line->selectionBottom() || (blocksAreFlipped && pointInLogicalContents.y() == line->selectionBottom())) {
+ if (pointInLogicalContents.y() < line->enclosingBottom() || (blocksAreFlipped && pointInLogicalContents.y() == line->enclosingBottom())) {
if (linesAreFlipped) {
auto nextLineWithChildren = line->next();
while (nextLineWithChildren && !nextLineWithChildren->firstLeafBox())
@@ -3405,7 +3405,7 @@
if (closestRun) {
if (moveCaretToBoundary) {
- LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->selectionTopForHitTesting(), LayoutUnit(firstLineWithChildren->top()));
+ LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->enclosingTopForHitTesting(), LayoutUnit(firstLineWithChildren->top()));
if (pointInLogicalContents.y() < firstLineWithChildrenTop
|| (blocksAreFlipped && pointInLogicalContents.y() == firstLineWithChildrenTop)) {
auto run = firstLineWithChildren->firstLeafBox();
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.h 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h 2022-03-15 21:17:33 UTC (rev 291312)
@@ -393,7 +393,7 @@
LayoutUnit endPaddingWidthForCaret() const;
- LayoutUnit adjustSelectionTopForPrecedingBlock(LayoutUnit top) const;
+ LayoutUnit adjustEnclosingTopForPrecedingBlock(LayoutUnit top) const;
protected:
bool shouldResetLogicalHeightBeforeLayout() const override { return true; }
Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderImage.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -110,8 +110,8 @@
}
} else {
auto line = run->line();
- LayoutUnit selectionTop = !containingBlock->style().isFlippedBlocksWritingMode() ? line->selectionTop() - logicalTop() : logicalBottom() - line->selectionBottom();
- imageRect = IntRect(0, selectionTop, logicalWidth(), line->selectionHeight());
+ LayoutUnit selectionTop = !containingBlock->style().isFlippedBlocksWritingMode() ? line->enclosingTop() - logicalTop() : logicalBottom() - line->enclosingBottom();
+ imageRect = IntRect(0, selectionTop, logicalWidth(), line->enclosingHeight());
isFirstOnLine = !run->previousOnLine();
isLastOnLine = !run->nextOnLine();
LogicalSelectionOffsetCaches cache(*containingBlock);
Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -187,7 +187,7 @@
return;
auto line = run->line();
- auto lineSelectionRect = line->selectionLogicalRect();
+ auto lineSelectionRect = line->enclosingLogicalRect();
LayoutRect rect = IntRect(run->logicalLeft(), lineSelectionRect.y(), 0, lineSelectionRect.height());
if (!line->isHorizontal())
rect = rect.transposedRect();
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -721,7 +721,7 @@
auto [top, bottom] = [&] {
if (auto run = InlineIterator::boxFor(*this)) {
auto line = run->line();
- return std::make_pair(line->selectionTopForHitTesting(), line->selectionBottom());
+ return std::make_pair(line->enclosingTopForHitTesting(), line->enclosingBottom());
}
return std::make_pair(logicalTop(), logicalBottom());
}();
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -673,9 +673,9 @@
run.traverseNextTextBox();
auto line = run->line();
- LayoutUnit top = std::min(line->selectionTopForHitTesting(), line->top());
+ LayoutUnit top = std::min(line->enclosingTopForHitTesting(), line->top());
if (pointBlockDirection > top || (!blocksAreFlipped && pointBlockDirection == top)) {
- LayoutUnit bottom = line->selectionBottom();
+ LayoutUnit bottom = line->enclosingBottom();
if (auto nextLine = line->next())
bottom = std::min(bottom, nextLine->top());
Modified: trunk/Source/WebCore/rendering/TextBoxPainter.cpp (291311 => 291312)
--- trunk/Source/WebCore/rendering/TextBoxPainter.cpp 2022-03-15 20:45:47 UTC (rev 291311)
+++ trunk/Source/WebCore/rendering/TextBoxPainter.cpp 2022-03-15 21:17:33 UTC (rev 291312)
@@ -290,8 +290,8 @@
// draw its own highlight.
const auto line = textBox().line();
- LayoutUnit selectionBottom = line->selectionBottom();
- LayoutUnit selectionTop = line->selectionTopAdjustedForPrecedingBlock();
+ LayoutUnit selectionBottom = line->enclosingBottom();
+ LayoutUnit selectionTop = line->enclosingTopAdjustedForPrecedingBlock();
// Use same y positioning and height as for selection, so that when the selection and this subrange are on
// the same word there are no pieces sticking out.