Title: [291208] trunk/Source/WebCore
Revision
291208
Author
[email protected]
Date
2022-03-12 11:10:20 -0800 (Sat, 12 Mar 2022)

Log Message

[IFC][Integration] previousLinePosition/nextLinePosition should use Line::lineBoxHeight
https://bugs.webkit.org/show_bug.cgi?id=237788

Reviewed by Antti Koivisto.

Line::lineBoxHeight() should be sufficient for checking if the line is empty for VisualPosition.

* editing/VisibleUnits.cpp:
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
* layout/integration/InlineIteratorLine.h:
(WebCore::InlineIterator::Line::lineBoxHeight const):
(WebCore::InlineIterator::Line::logicalHeight const): Deleted.
* layout/integration/InlineIteratorLineLegacyPath.h:
(WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalRight const):
(WebCore::InlineIterator::LineIteratorLegacyPath::logicalHeight const): Deleted.
* layout/integration/InlineIteratorLineModernPath.h:
(WebCore::InlineIterator::LineIteratorModernPath::contentLogicalRight const):
(WebCore::InlineIterator::LineIteratorModernPath::logicalHeight const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291207 => 291208)


--- trunk/Source/WebCore/ChangeLog	2022-03-12 14:30:45 UTC (rev 291207)
+++ trunk/Source/WebCore/ChangeLog	2022-03-12 19:10:20 UTC (rev 291208)
@@ -1,5 +1,27 @@
 2022-03-12  Alan Bujtas  <[email protected]>
 
+        [IFC][Integration] previousLinePosition/nextLinePosition should use Line::lineBoxHeight
+        https://bugs.webkit.org/show_bug.cgi?id=237788
+
+        Reviewed by Antti Koivisto.
+
+        Line::lineBoxHeight() should be sufficient for checking if the line is empty for VisualPosition.
+
+        * editing/VisibleUnits.cpp:
+        (WebCore::previousLinePosition):
+        (WebCore::nextLinePosition):
+        * layout/integration/InlineIteratorLine.h:
+        (WebCore::InlineIterator::Line::lineBoxHeight const):
+        (WebCore::InlineIterator::Line::logicalHeight const): Deleted.
+        * layout/integration/InlineIteratorLineLegacyPath.h:
+        (WebCore::InlineIterator::LineIteratorLegacyPath::contentLogicalRight const):
+        (WebCore::InlineIterator::LineIteratorLegacyPath::logicalHeight const): Deleted.
+        * layout/integration/InlineIteratorLineModernPath.h:
+        (WebCore::InlineIterator::LineIteratorModernPath::contentLogicalRight const):
+        (WebCore::InlineIterator::LineIteratorModernPath::logicalHeight const): Deleted.
+
+2022-03-12  Alan Bujtas  <[email protected]>
+
         [IFC][Integration] RenderBlockFlow::findClosestTextAtAbsolutePoint should use root inline box iterator
         https://bugs.webkit.org/show_bug.cgi?id=237786
 

Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (291207 => 291208)


--- trunk/Source/WebCore/editing/VisibleUnits.cpp	2022-03-12 14:30:45 UTC (rev 291207)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp	2022-03-12 19:10:20 UTC (rev 291208)
@@ -973,7 +973,7 @@
         line = run->line()->previous();
         // We want to skip zero height boxes.
         // This could happen in case it is a LegacyRootInlineBox with trailing floats.
-        if (!line || !line->logicalHeight() || !line->firstLeafBox())
+        if (!line || !line->lineBoxHeight() || !line->firstLeafBox())
             line = { };
     }
 
@@ -1026,7 +1026,7 @@
         line = run->line()->next();
         // We want to skip zero height boxes.
         // This could happen in case it is a LegacyRootInlineBox with trailing floats.
-        if (!line || !line->logicalHeight() || !line->firstLeafBox())
+        if (!line || !line->lineBoxHeight() || !line->firstLeafBox())
             line = { };
     }
 

Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLine.h (291207 => 291208)


--- trunk/Source/WebCore/layout/integration/InlineIteratorLine.h	2022-03-12 14:30:45 UTC (rev 291207)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLine.h	2022-03-12 19:10:20 UTC (rev 291208)
@@ -60,6 +60,7 @@
     LayoutUnit selectionHeightAdjustedForPrecedingBlock() const;
     LayoutUnit lineBoxTop() const;
     LayoutUnit lineBoxBottom() const;
+    LayoutUnit lineBoxHeight() const { return lineBoxBottom() - lineBoxTop(); }
 
     LayoutRect selectionRect() const;
     RenderObject::HighlightState selectionState() const;
@@ -67,7 +68,6 @@
     float contentLogicalLeft() const;
     float contentLogicalRight() const;
     float contentLogicalWidth() const;
-    float logicalHeight() const;
 
     int blockDirectionPointInLine() const;
 
@@ -214,13 +214,6 @@
     return contentLogicalRight() - contentLogicalLeft();
 }
 
-inline float Line::logicalHeight() const
-{
-    return WTF::switchOn(m_pathVariant, [](const auto& path) {
-        return path.logicalHeight();
-    });
-}
-
 inline bool Line::isHorizontal() const
 {
     return WTF::switchOn(m_pathVariant, [](const auto& path) {

Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h (291207 => 291208)


--- trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h	2022-03-12 14:30:45 UTC (rev 291207)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineLegacyPath.h	2022-03-12 19:10:20 UTC (rev 291208)
@@ -53,7 +53,6 @@
 
     float contentLogicalLeft() const { return m_rootInlineBox->logicalLeft(); }
     float contentLogicalRight() const { return m_rootInlineBox->logicalRight(); }
-    float logicalHeight() const { return m_rootInlineBox->logicalHeight(); }
     bool isHorizontal() const { return m_rootInlineBox->isHorizontal(); }
     FontBaseline baselineType() const { return m_rootInlineBox->baselineType(); }
 

Modified: trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h (291207 => 291208)


--- trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h	2022-03-12 14:30:45 UTC (rev 291207)
+++ trunk/Source/WebCore/layout/integration/InlineIteratorLineModernPath.h	2022-03-12 19:10:20 UTC (rev 291208)
@@ -64,7 +64,6 @@
 
     float contentLogicalLeft() const { return line().lineBoxLeft() + line().contentLogicalOffset(); }
     float contentLogicalRight() const { return contentLogicalLeft() + line().contentLogicalWidth(); }
-    float logicalHeight() const { return lineBoxBottom() - lineBoxTop(); }
     bool isHorizontal() const { return line().isHorizontal(); }
     FontBaseline baselineType() const { return line().baselineType(); }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to