Title: [291512] trunk/Source/WebCore
- Revision
- 291512
- Author
- [email protected]
- Date
- 2022-03-18 17:40:53 -0700 (Fri, 18 Mar 2022)
Log Message
[IFC][Integration] InlineIterator::Line::enclosingTop is really an enclosingTopAdjustedForPrecedingLine
https://bugs.webkit.org/show_bug.cgi?id=238079
Reviewed by Antti Koivisto.
This is used for selection and hittesting.
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::Line::enclosingLogicalRect const):
(WebCore::InlineIterator::Line::enclosingTop const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTop const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const):
(WebCore::InlineIterator::LineIteratorModernPath::enclosingTop const): Deleted.
* layout/integration/LineSelection.h:
(WebCore::LineSelection::logicalTop):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (291511 => 291512)
--- trunk/Source/WebCore/ChangeLog 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/ChangeLog 2022-03-19 00:40:53 UTC (rev 291512)
@@ -1,3 +1,28 @@
+2022-03-18 Alan Bujtas <[email protected]>
+
+ [IFC][Integration] InlineIterator::Line::enclosingTop is really an enclosingTopAdjustedForPrecedingLine
+ https://bugs.webkit.org/show_bug.cgi?id=238079
+
+ Reviewed by Antti Koivisto.
+
+ This is used for selection and hittesting.
+
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingBlock const):
+ * layout/integration/InlineIteratorLine.h:
+ (WebCore::InlineIterator::Line::enclosingTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::Line::enclosingLogicalRect const):
+ (WebCore::InlineIterator::Line::enclosingTop const): Deleted.
+ * layout/integration/InlineIteratorLineLegacyPath.h:
+ (WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::LineIteratorLegacyPath::enclosingTop const): Deleted.
+ * layout/integration/InlineIteratorLineModernPath.h:
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTopAdjustedForPrecedingLine const):
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTopForHitTesting const):
+ (WebCore::InlineIterator::LineIteratorModernPath::enclosingTop const): Deleted.
+ * layout/integration/LineSelection.h:
+ (WebCore::LineSelection::logicalTop):
+
2022-03-18 Chris Dumez <[email protected]>
Optimize AtomHTMLToken::initializeAttributes()
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp (291511 => 291512)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-03-19 00:40:53 UTC (rev 291512)
@@ -164,7 +164,7 @@
LayoutUnit Line::enclosingTopAdjustedForPrecedingBlock() const
{
- return containingBlock().adjustEnclosingTopForPrecedingBlock(enclosingTop());
+ return containingBlock().adjustEnclosingTopForPrecedingBlock(enclosingTopAdjustedForPrecedingLine());
}
LayoutUnit Line::enclosingHeightAdjustedForPrecedingBlock() const
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (291511 => 291512)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h 2022-03-19 00:40:53 UTC (rev 291512)
@@ -95,12 +95,12 @@
// FIXME: This is temporary.
friend class WebCore::LineSelection;
- LayoutUnit enclosingTop() const;
LayoutUnit enclosingBottom() const;
LayoutRect enclosingLogicalRect() const;
LayoutRect enclosingPhysicalRect() const;
+ LayoutUnit enclosingTopAdjustedForPrecedingLine() const;
LayoutUnit enclosingTopAdjustedForPrecedingBlock() const;
LayoutUnit enclosingHeightAdjustedForPrecedingBlock() const;
@@ -161,10 +161,10 @@
});
}
-inline LayoutUnit Line::enclosingTop() const
+inline LayoutUnit Line::enclosingTopAdjustedForPrecedingLine() const
{
return WTF::switchOn(m_pathVariant, [](const auto& path) {
- return path.enclosingTop();
+ return path.enclosingTopAdjustedForPrecedingLine();
});
}
@@ -198,7 +198,7 @@
inline LayoutRect Line::enclosingLogicalRect() const
{
- return { LayoutPoint { contentLogicalLeft(), enclosingTop() }, LayoutPoint { contentLogicalRight(), enclosingBottom() } };
+ return { LayoutPoint { contentLogicalLeft(), enclosingTopAdjustedForPrecedingLine() }, LayoutPoint { contentLogicalRight(), enclosingBottom() } };
}
inline LayoutRect Line::enclosingPhysicalRect() const
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h (291511 => 291512)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h 2022-03-19 00:40:53 UTC (rev 291512)
@@ -45,7 +45,7 @@
LayoutUnit top() const { return m_rootInlineBox->lineTop(); }
LayoutUnit bottom() const { return m_rootInlineBox->lineBottom(); }
- LayoutUnit enclosingTop() const { return m_rootInlineBox->selectionTop(); }
+ LayoutUnit enclosingTopAdjustedForPrecedingLine() 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(); }
Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h (291511 => 291512)
--- trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h 2022-03-19 00:40:53 UTC (rev 291512)
@@ -54,11 +54,11 @@
LayoutUnit lineBoxTop() const { return LayoutUnit::fromFloatRound(line().lineBoxTop()); }
LayoutUnit lineBoxBottom() const { return LayoutUnit::fromFloatRound(line().lineBoxBottom()); }
- LayoutUnit enclosingTop() const { return !m_lineIndex ? top() : LineIteratorModernPath(*m_inlineContent, m_lineIndex - 1).enclosingBottom(); }
+ LayoutUnit enclosingTopAdjustedForPrecedingLine() 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 enclosingTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : enclosingTop(); };
+ LayoutUnit enclosingTopForHitTesting() const { return !m_lineIndex ? containingBlock().borderAndPaddingBefore() : enclosingTopAdjustedForPrecedingLine(); };
// FIXME: Implement or replace.
LayoutUnit enclosingBottom() const { return bottom(); }
Modified: trunk/Source/WebCore/layout/integration/LineSelection.h (291511 => 291512)
--- trunk/Source/WebCore/layout/integration/LineSelection.h 2022-03-19 00:31:59 UTC (rev 291511)
+++ trunk/Source/WebCore/layout/integration/LineSelection.h 2022-03-19 00:40:53 UTC (rev 291512)
@@ -31,7 +31,7 @@
class LineSelection {
public:
- static LayoutUnit logicalTop(const InlineIterator::Line& line) { return line.enclosingTop(); }
+ static LayoutUnit logicalTop(const InlineIterator::Line& line) { return line.enclosingTopAdjustedForPrecedingLine(); }
static LayoutUnit logicalBottom(const InlineIterator::Line& line) { return line.enclosingBottom(); }
static LayoutRect logicalRect(const InlineIterator::Line& line) { return line.enclosingLogicalRect(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes