Diff
Modified: trunk/Source/WebCore/ChangeLog (291529 => 291530)
--- trunk/Source/WebCore/ChangeLog 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/ChangeLog 2022-03-19 19:17:07 UTC (rev 291530)
@@ -1,5 +1,30 @@
2022-03-19 Alan Bujtas <[email protected]>
+ [IFC][Integration] Rename InlineIterator::Line:top/bottom to contentLogicalTop/contentLogicalBottom
+ https://bugs.webkit.org/show_bug.cgi?id=238085
+
+ Reviewed by Antti Koivisto.
+
+ * layout/integration/InlineIteratorLine.h:
+ (WebCore::InlineIterator::Line::contentLogicalTop const):
+ (WebCore::InlineIterator::Line::contentLogicalBottom const):
+ (WebCore::InlineIterator::Line::top const): Deleted.
+ (WebCore::InlineIterator::Line::bottom const): Deleted.
+ * layout/integration/InlineIteratorLineLegacyPath.h:
+ (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTop const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottom const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::top const): Deleted.
+ (WebCore::InlineIterator::LineIteratorLegacyPath::bottom const): Deleted.
+ * layout/integration/InlineIteratorLineModernPath.h:
+ (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTop const):
+ (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottom const):
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const):
+ (WebCore::InlineIterator::LineIteratorModernPath::top const): Deleted.
+ (WebCore::InlineIterator::LineIteratorModernPath::bottom const): Deleted.
+
+2022-03-19 Alan Bujtas <[email protected]>
+
[IFC][Integration] InlineIterator::Line::enclosingBottom should read enclosingBottomAdjustedForFollowingLine
https://bugs.webkit.org/show_bug.cgi?id=238084
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp (291529 => 291530)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -159,7 +159,7 @@
int Line::blockDirectionPointInLine() const
{
- return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(top(), enclosingTopForHitTesting()) : std::min(bottom(), enclosingBottomAdjustedForFollowingLine());
+ return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(contentLogicalTop(), enclosingTopForHitTesting()) : std::min(contentLogicalBottom(), enclosingBottomAdjustedForFollowingLine());
}
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (291529 => 291530)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 19:17:07 UTC (rev 291530)
@@ -54,13 +54,13 @@
Line(PathVariant&&);
- LayoutUnit top() const;
- LayoutUnit bottom() const;
-
LayoutUnit lineBoxTop() const;
LayoutUnit lineBoxBottom() const;
LayoutUnit lineBoxHeight() const { return lineBoxBottom() - lineBoxTop(); }
+ // FIXME: Make sure we use the same type for content geometry.
+ LayoutUnit contentLogicalTop() const;
+ LayoutUnit contentLogicalBottom() const;
float contentLogicalLeft() const;
float contentLogicalRight() const;
float contentLogicalWidth() const;
@@ -139,17 +139,17 @@
{
}
-inline LayoutUnit Line::top() const
+inline LayoutUnit Line::contentLogicalTop() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.top();
+ return path.contentLogicalTop();
});
}
-inline LayoutUnit Line::bottom() const
+inline LayoutUnit Line::contentLogicalBottom() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.bottom();
+ return path.contentLogicalBottom();
});
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h (291529 => 291530)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 19:17:07 UTC (rev 291530)
@@ -43,8 +43,8 @@
LineIteratorLegacyPath& operator=(const LineIteratorLegacyPath&) = default;
LineIteratorLegacyPath& operator=(LineIteratorLegacyPath&&) = default;
- LayoutUnit top() const { return m_rootInlineBox->lineTop(); }
- LayoutUnit bottom() const { return m_rootInlineBox->lineBottom(); }
+ LayoutUnit contentLogicalTop() const { return m_rootInlineBox->lineTop(); }
+ LayoutUnit contentLogicalBottom() const { return m_rootInlineBox->lineBottom(); }
LayoutUnit enclosingTopAdjustedForPrecedingLine() const { return m_rootInlineBox->selectionTop(); }
LayoutUnit enclosingTopForHitTesting() const { return m_rootInlineBox->selectionTop(LegacyRootInlineBox::ForHitTesting::Yes); }
LayoutUnit enclosingBottomAdjustedForFollowingLine() const { return m_rootInlineBox->selectionBottom(); }
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h (291529 => 291530)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 19:17:07 UTC (rev 291530)
@@ -49,18 +49,18 @@
LineIteratorModernPath& operator=(const LineIteratorModernPath&) = default;
LineIteratorModernPath& operator=(LineIteratorModernPath&&) = default;
- LayoutUnit top() const { return LayoutUnit::fromFloatRound(line().enclosingContentTop()); }
- LayoutUnit bottom() const { return LayoutUnit::fromFloatRound(line().enclosingContentBottom()); }
+ LayoutUnit contentLogicalTop() const { return LayoutUnit::fromFloatRound(line().enclosingContentTop()); }
+ LayoutUnit contentLogicalBottom() const { return LayoutUnit::fromFloatRound(line().enclosingContentBottom()); }
LayoutUnit lineBoxTop() const { return LayoutUnit::fromFloatRound(line().lineBoxTop()); }
LayoutUnit lineBoxBottom() const { return LayoutUnit::fromFloatRound(line().lineBoxBottom()); }
- LayoutUnit enclosingTopAdjustedForPrecedingLine() const { return !m_lineIndex ? top() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).enclosingBottomAdjustedForFollowingLine(); }
+ LayoutUnit enclosingTopAdjustedForPrecedingLine() const { return !m_lineIndex ? contentLogicalTop() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).enclosingBottomAdjustedForFollowingLine(); }
// 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 enclosingTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : enclosingTopAdjustedForPrecedingLine(); };
// FIXME: Implement.
- LayoutUnit enclosingBottomAdjustedForFollowingLine() const { return bottom(); }
+ LayoutUnit enclosingBottomAdjustedForFollowingLine() const { return contentLogicalBottom(); }
float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLogicalOffset(); }
float contentLogicalRight() const { return contentLogicalLeft() + line().contentLogicalWidth(); }
Modified: trunk/Source/WebCore/rendering/CaretRectComputation.cpp (291529 => 291530)
--- trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/rendering/CaretRectComputation.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -229,9 +229,9 @@
if (boxAndOffset.box) {
auto line = boxAndOffset.box->line();
- LayoutUnit top = line->top();
+ auto top = line->contentLogicalTop();
rect.setY(top);
- rect.setHeight(line->bottom() - top);
+ rect.setHeight(line->contentLogicalBottom() - top);
}
// If height of box is smaller than font height, use the latter one,
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (291529 => 291530)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -3421,7 +3421,7 @@
if (closestBox) {
if (moveCaretToBoundary) {
- LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->enclosingTopForHitTesting(), LayoutUnit(firstLineWithChildren->top()));
+ LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->enclosingTopForHitTesting(), LayoutUnit(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->top(), LayoutUnit { unflippedVisualRect.y() });
- auto bottom = std::min(line->bottom(), LayoutUnit { unflippedVisualRect.maxY() });
+ auto top = std::max(line->contentLogicalTop(), LayoutUnit { unflippedVisualRect.y() });
+ auto bottom = std::min(line->contentLogicalBottom(), LayoutUnit { unflippedVisualRect.maxY() });
auto rect = LayoutRect { LayoutUnit { additionalOffset.x() + unflippedVisualRect.x() }
, additionalOffset.y() + top
, LayoutUnit { unflippedVisualRect.width() }
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (291529 => 291530)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -1591,7 +1591,7 @@
if (is<RenderText>(*o)) {
auto& textRenderer = downcast<RenderText>(*o);
if (auto run = InlineIterator::firstTextBoxFor(textRenderer))
- point.move(textRenderer.linesBoundingBox().x(), run->line()->top());
+ point.move(textRenderer.linesBoundingBox().x(), run->line()->contentLogicalTop());
} else if (is<RenderBox>(*o))
point.moveBy(downcast<RenderBox>(*o).location());
point = o->container()->localToAbsolute(point, UseTransforms, &insideFixed);
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (291529 => 291530)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -974,8 +974,8 @@
for (auto box = InlineIterator::firstInlineBoxFor(*this); box; box.traverseNextInlineBox()) {
auto line = box->line();
- LayoutUnit top = std::max(line->top(), LayoutUnit(box->logicalTop()));
- LayoutUnit bottom = std::min(line->bottom(), LayoutUnit(box->logicalBottom()));
+ auto top = std::max(line->contentLogicalTop(), LayoutUnit(box->logicalTop()));
+ auto bottom = std::min(line->contentLogicalBottom(), LayoutUnit(box->logicalBottom()));
// FIXME: This is mixing physical and logical coordinates.
rects.append({ LayoutUnit(box->visualRectIgnoringBlockDirection().x()), top, LayoutUnit(box->logicalWidth()), bottom - top });
}
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (291529 => 291530)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-19 18:21:43 UTC (rev 291529)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-19 19:17:07 UTC (rev 291530)
@@ -674,11 +674,11 @@
run.traverseNextTextBox();
auto line = run->line();
- LayoutUnit top = std::min(line->enclosingTopForHitTesting(), line->top());
+ auto top = std::min(line->enclosingTopForHitTesting(), line->contentLogicalTop());
if (pointBlockDirection > top || (!blocksAreFlipped && pointBlockDirection == top)) {
auto bottom = LineSelection::logicalBottom(*line);
if (auto nextLine = line->next())
- bottom = std::min(bottom, nextLine->top());
+ bottom = std::min(bottom, nextLine->contentLogicalTop());
if (pointBlockDirection < bottom || (blocksAreFlipped && pointBlockDirection == bottom)) {
ShouldAffinityBeDownstream shouldAffinityBeDownstream;