- Revision
- 291531
- Author
- [email protected]
- Date
- 2022-03-19 13:05:24 -0700 (Sat, 19 Mar 2022)
Log Message
[IFC][Integration] Use a more descriptive name for InlineIterator::Line::enclosing* functions
https://bugs.webkit.org/show_bug.cgi?id=238094
Reviewed by Antti Koivisto.
Enlcosing essentially means content logical top/bottom here.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::blockDirectionPointInLine const):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::Line::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::Line::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const): Deleted.
(WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
(WebCore::LineSelection::logicalBottom):
(WebCore::LineSelection::logicalRect):
(WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (291530 => 291531)
--- trunk/Source/WebCore/ChangeLog 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/ChangeLog 2022-03-19 20:05:24 UTC (rev 291531)
@@ -1,5 +1,49 @@
2022-03-19 Alan Bujtas <[email protected]>
+ [IFC][Integration] Use a more descriptive name for InlineIterator::Line::enclosing* functions
+ https://bugs.webkit.org/show_bug.cgi?id=238094
+
+ Reviewed by Antti Koivisto.
+
+ Enlcosing essentially means content logical top/bottom here.
+
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::blockDirectionPointInLine const):
+ * layout/integration/InlineIteratorLine.h:
+ (WebCore::InlineIterator::Line::contentLogicalTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::Line::contentLogicalTopForHitTesting const):
+ (WebCore::InlineIterator::Line::contentLogicalBottomAdjustedForFollowingLine const):
+ (WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const): Deleted.
+ (WebCore::InlineIterator::Line::enclosingTopForHitTesting const): Deleted.
+ (WebCore::InlineIterator::Line::enclosingBottomAdjustedForFollowingLine const): Deleted.
+ * layout/integration/InlineIteratorLineLegacyPath.h:
+ (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalTopForHitTesting const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalBottomAdjustedForFollowingLine const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
+ (WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopForHitTesting const): Deleted.
+ (WebCore::InlineIterator::LineIteratorLegacyPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
+ * layout/integration/InlineIteratorLineModernPath.h:
+ (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalTopForHitTesting const):
+ (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalBottomAdjustedForFollowingLine const):
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const): Deleted.
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const): Deleted.
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingBottomAdjustedForFollowingLine const): Deleted.
+ * layout/integration/LineSelection.h:
+ (WebCore::LineSelection::logicalTop):
+ (WebCore::LineSelection::logicalBottom):
+ (WebCore::LineSelection::logicalRect):
+ (WebCore::LineSelection::logicalTopAdjustedForPrecedingBlock):
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::positionForPoint):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::positionForPoint):
+
+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
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp (291530 => 291531)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 20:05:24 UTC (rev 291531)
@@ -159,7 +159,7 @@
int Line::blockDirectionPointInLine() const
{
- return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(contentLogicalTop(), enclosingTopForHitTesting()) : std::min(contentLogicalBottom(), enclosingBottomAdjustedForFollowingLine());
+ return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(contentLogicalTop(), contentLogicalTopForHitTesting()) : std::min(contentLogicalBottom(), contentLogicalBottomAdjustedForFollowingLine());
}
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (291530 => 291531)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 20:05:24 UTC (rev 291531)
@@ -65,7 +65,7 @@
float contentLogicalRight() const;
float contentLogicalWidth() const;
- LayoutUnit enclosingTopForHitTesting() const;
+ LayoutUnit contentLogicalTopForHitTesting() const;
int blockDirectionPointInLine() const;
@@ -95,8 +95,8 @@
// FIXME: This is temporary.
friend class WebCore::LineSelection;
- LayoutUnit enclosingTopAdjustedForPrecedingLine() const;
- LayoutUnit enclosingBottomAdjustedForFollowingLine() const;
+ LayoutUnit contentLogicalTopAdjustedForPrecedingLine() const;
+ LayoutUnit contentLogicalBottomAdjustedForFollowingLine() const;
PathVariant m_pathVariant;
};
@@ -153,24 +153,24 @@
});
}
-inline LayoutUnit Line::enclosingTopAdjustedForPrecedingLine() const
+inline LayoutUnit Line::contentLogicalTopAdjustedForPrecedingLine() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.enclosingTopAdjustedForPrecedingLine();
+ return path.contentLogicalTopAdjustedForPrecedingLine();
});
}
-inline LayoutUnit Line::enclosingTopForHitTesting() const
+inline LayoutUnit Line::contentLogicalTopForHitTesting() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.enclosingTopForHitTesting();
+ return path.contentLogicalTopForHitTesting();
});
}
-inline LayoutUnit Line::enclosingBottomAdjustedForFollowingLine() const
+inline LayoutUnit Line::contentLogicalBottomAdjustedForFollowingLine() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.enclosingBottomAdjustedForFollowingLine();
+ return path.contentLogicalBottomAdjustedForFollowingLine();
});
}
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h (291530 => 291531)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 20:05:24 UTC (rev 291531)
@@ -45,9 +45,9 @@
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(); }
+ LayoutUnit contentLogicalTopAdjustedForPrecedingLine() const { return m_rootInlineBox->selectionTop(); }
+ LayoutUnit contentLogicalTopForHitTesting() const { return m_rootInlineBox->selectionTop(LegacyRootInlineBox::ForHitTesting::Yes); }
+ LayoutUnit contentLogicalBottomAdjustedForFollowingLine() 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 (291530 => 291531)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 20:05:24 UTC (rev 291531)
@@ -54,13 +54,13 @@
LayoutUnit lineBoxTop() const { return LayoutUnit::fromFloatRound(line().lineBoxTop()); }
LayoutUnit lineBoxBottom() const { return LayoutUnit::fromFloatRound(line().lineBoxBottom()); }
- LayoutUnit enclosingTopAdjustedForPrecedingLine() const { return !m_lineIndex ? contentLogicalTop() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).enclosingBottomAdjustedForFollowingLine(); }
+ LayoutUnit contentLogicalTopAdjustedForPrecedingLine() const { return !m_lineIndex ? contentLogicalTop() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).contentLogicalBottomAdjustedForFollowingLine(); }
// 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(); };
+ LayoutUnit contentLogicalTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : contentLogicalTopAdjustedForPrecedingLine(); };
// FIXME: Implement.
- LayoutUnit enclosingBottomAdjustedForFollowingLine() const { return contentLogicalBottom(); }
+ LayoutUnit contentLogicalBottomAdjustedForFollowingLine() const { return contentLogicalBottom(); }
float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLogicalOffset(); }
float contentLogicalRight() const { return contentLogicalLeft() + line().contentLogicalWidth(); }
Modified: trunk/Source/WebCore/layout/integration/LineSelection.h (291530 => 291531)
--- trunk/Source/WebCore/layout/integration/LineSelection.h 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/layout/integration/LineSelection.h 2022-03-19 20:05:24 UTC (rev 291531)
@@ -32,12 +32,12 @@
class LineSelection {
public:
- static LayoutUnit logicalTop(const InlineIterator::Line& line) { return line.enclosingTopAdjustedForPrecedingLine(); }
- static LayoutUnit logicalBottom(const InlineIterator::Line& line) { return line.enclosingBottomAdjustedForFollowingLine(); }
+ static LayoutUnit logicalTop(const InlineIterator::Line& line) { return line.contentLogicalTopAdjustedForPrecedingLine(); }
+ static LayoutUnit logicalBottom(const InlineIterator::Line& line) { return line.contentLogicalBottomAdjustedForFollowingLine(); }
static LayoutRect logicalRect(const InlineIterator::Line& line)
{
- return { LayoutPoint { line.contentLogicalLeft(), line.enclosingTopAdjustedForPrecedingLine() }, LayoutPoint { line.contentLogicalRight(), line.enclosingBottomAdjustedForFollowingLine() } };
+ return { LayoutPoint { line.contentLogicalLeft(), line.contentLogicalTopAdjustedForPrecedingLine() }, LayoutPoint { line.contentLogicalRight(), line.contentLogicalBottomAdjustedForFollowingLine() } };
}
static LayoutRect physicalRect(const InlineIterator::Line& line)
@@ -52,7 +52,7 @@
static LayoutUnit logicalTopAdjustedForPrecedingBlock(const InlineIterator::Line& line)
{
// FIXME: Move adjustEnclosingTopForPrecedingBlock from RenderBlockFlow to here.
- return line.containingBlock().adjustEnclosingTopForPrecedingBlock(line.enclosingTopAdjustedForPrecedingLine());
+ return line.containingBlock().adjustEnclosingTopForPrecedingBlock(line.contentLogicalTopAdjustedForPrecedingLine());
}
static RenderObject::HighlightState selectionState(const InlineIterator::Line& line)
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (291530 => 291531)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2022-03-19 20:05:24 UTC (rev 291531)
@@ -3421,7 +3421,7 @@
if (closestBox) {
if (moveCaretToBoundary) {
- LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->enclosingTopForHitTesting(), LayoutUnit(firstLineWithChildren->contentLogicalTop()));
+ LayoutUnit firstLineWithChildrenTop = std::min(firstLineWithChildren->contentLogicalTopForHitTesting(), LayoutUnit(firstLineWithChildren->contentLogicalTop()));
if (pointInLogicalContents.y() < firstLineWithChildrenTop
|| (blocksAreFlipped && pointInLogicalContents.y() == firstLineWithChildrenTop)) {
auto box = firstLineWithChildren->firstLeafBox();
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (291530 => 291531)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2022-03-19 20:05:24 UTC (rev 291531)
@@ -722,7 +722,7 @@
auto [top, bottom] = [&] {
if (auto run = InlineIterator::boxFor(*this)) {
auto line = run->line();
- return std::make_pair(line->enclosingTopForHitTesting(), LineSelection::logicalBottom(*line));
+ return std::make_pair(line->contentLogicalTopForHitTesting(), LineSelection::logicalBottom(*line));
}
return std::make_pair(logicalTop(), logicalBottom());
}();
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (291530 => 291531)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-19 19:17:07 UTC (rev 291530)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2022-03-19 20:05:24 UTC (rev 291531)
@@ -674,7 +674,7 @@
run.traverseNextTextBox();
auto line = run->line();
- auto top = std::min(line->enclosingTopForHitTesting(), line->contentLogicalTop());
+ auto top = std::min(line->contentLogicalTopForHitTesting(), line->contentLogicalTop());
if (pointBlockDirection > top || (!blocksAreFlipped && pointBlockDirection == top)) {
auto bottom = LineSelection::logicalBottom(*line);
if (auto nextLine = line->next())