Title: [270128] trunk/Source/WebCore
Revision
270128
Author
[email protected]
Date
2020-11-20 12:54:25 -0800 (Fri, 20 Nov 2020)

Log Message

[LFC][Integration] Rename LineIteratorLegacy::logicalLeft/right to contentLeft/right
https://bugs.webkit.org/show_bug.cgi?id=219215

Reviewed by Antti Koivisto.

These functions are supposed to return the position where the content starts/ends inside the line box (see text-alignment as an example
where the line's logical left edge is not where content starts).

(WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
* layout/integration/LayoutIntegrationLineIterator.h:
(WebCore::LayoutIntegration::PathLine::selectionRect const):
(WebCore::LayoutIntegration::PathLine::contentLogicalLeft const):
(WebCore::LayoutIntegration::PathLine::contentLogicalRight const):
(WebCore::LayoutIntegration::PathLine::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::PathLine::logicalRight const): Deleted.
* layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:
(WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalLeft const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalRight const):
(WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): Deleted.
* layout/integration/LayoutIntegrationLineIteratorModernPath.h:
(WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const):
(WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const):
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): Deleted.
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): Deleted.
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::localCaretRect const):
(WebCore::RenderLineBreak::collectSelectionRects):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (270127 => 270128)


--- trunk/Source/WebCore/ChangeLog	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/ChangeLog	2020-11-20 20:54:25 UTC (rev 270128)
@@ -1,3 +1,34 @@
+2020-11-20  Zalan Bujtas  <[email protected]>
+
+        [LFC][Integration] Rename LineIteratorLegacy::logicalLeft/right to contentLeft/right
+        https://bugs.webkit.org/show_bug.cgi?id=219215
+
+        Reviewed by Antti Koivisto.
+
+        These functions are supposed to return the position where the content starts/ends inside the line box (see text-alignment as an example
+        where the line's logical left edge is not where content starts).
+
+        (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const):
+        * layout/integration/LayoutIntegrationLineIterator.h:
+        (WebCore::LayoutIntegration::PathLine::selectionRect const):
+        (WebCore::LayoutIntegration::PathLine::contentLogicalLeft const):
+        (WebCore::LayoutIntegration::PathLine::contentLogicalRight const):
+        (WebCore::LayoutIntegration::PathLine::logicalLeft const): Deleted.
+        (WebCore::LayoutIntegration::PathLine::logicalRight const): Deleted.
+        * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h:
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalLeft const):
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalRight const):
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): Deleted.
+        (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): Deleted.
+        * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
+        (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const):
+        (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const):
+        (WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): Deleted.
+        (WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): Deleted.
+        * rendering/RenderLineBreak.cpp:
+        (WebCore::RenderLineBreak::localCaretRect const):
+        (WebCore::RenderLineBreak::collectSelectionRects):
+
 2020-11-20  Chris Dumez  <[email protected]>
 
         AudioWorkletProcessor::process() may get called on non-audio worklet thread and crash

Modified: trunk/Source/WebCore/editing/VisiblePosition.cpp (270127 => 270128)


--- trunk/Source/WebCore/editing/VisiblePosition.cpp	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/editing/VisiblePosition.cpp	2020-11-20 20:54:25 UTC (rev 270128)
@@ -660,7 +660,7 @@
         return { };
 
     auto line = run.line();
-    auto localRect = FloatRect { FloatPoint { line->logicalLeft(), line->selectionTop() }, FloatPoint { line->logicalRight(), line->selectionBottom() } };
+    auto localRect = FloatRect { FloatPoint { line->contentLogicalLeft(), line->selectionTop() }, FloatPoint { line->contentLogicalRight(), line->selectionBottom() } };
     if (!line->isHorizontal())
         localRect = localRect.transposedRect();
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h (270127 => 270128)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIterator.h	2020-11-20 20:54:25 UTC (rev 270128)
@@ -61,8 +61,8 @@
     LayoutRect selectionRect() const;
 
     float y() const;
-    float logicalLeft() const;
-    float logicalRight() const;
+    float contentLogicalLeft() const;
+    float contentLogicalRight() const;
     float logicalHeight() const;
 
     int blockDirectionPointInLine() const;
@@ -180,7 +180,7 @@
 
 inline LayoutRect PathLine::selectionRect() const
 {
-    return { LayoutPoint { logicalLeft(), selectionTop() }, LayoutPoint { logicalRight(), selectionBottom() } };
+    return { LayoutPoint { contentLogicalLeft(), selectionTop() }, LayoutPoint { contentLogicalRight(), selectionBottom() } };
 }
 
 inline float PathLine::y() const
@@ -190,17 +190,17 @@
     });
 }
 
-inline float PathLine::logicalLeft() const
+inline float PathLine::contentLogicalLeft() const
 {
     return WTF::switchOn(m_pathVariant, [](const auto& path) {
-        return path.logicalLeft();
+        return path.contentLogicalLeft();
     });
 }
 
-inline float PathLine::logicalRight() const
+inline float PathLine::contentLogicalRight() const
 {
     return WTF::switchOn(m_pathVariant, [](const auto& path) {
-        return path.logicalRight();
+        return path.contentLogicalRight();
     });
 }
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h (270127 => 270128)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorLegacyPath.h	2020-11-20 20:54:25 UTC (rev 270128)
@@ -53,8 +53,8 @@
     LayoutUnit lineBoxBottom() const { return m_rootInlineBox->lineBoxBottom(); }
 
     float y() const { return m_rootInlineBox->y(); }
-    float logicalLeft() const { return m_rootInlineBox->logicalLeft(); }
-    float logicalRight() const { return m_rootInlineBox->logicalRight(); }
+    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(); }
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h (270127 => 270128)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h	2020-11-20 20:54:25 UTC (rev 270128)
@@ -59,8 +59,8 @@
     LayoutUnit selectionTopForHitTesting() const { return top(); }
     LayoutUnit selectionBottom() const { return bottom(); }
 
-    float logicalLeft() const { return line().rect().x() + line().horizontalAlignmentOffset(); }
-    float logicalRight() const { return logicalLeft() + line().lineBoxWidth(); }
+    float contentLogicalLeft() const { return line().rect().x() + line().horizontalAlignmentOffset(); }
+    float contentLogicalRight() const { return contentLogicalLeft() + line().rect().width(); }
     float y() const { return lineBoxTop(); }
     float logicalHeight() const { return line().rect().height(); }
     bool isHorizontal() const { return true; }

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (270127 => 270128)


--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2020-11-20 20:48:22 UTC (rev 270127)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2020-11-20 20:54:25 UTC (rev 270128)
@@ -167,7 +167,7 @@
         return LayoutRect();
 
     auto line = runAndOffset.run.line();
-    return line->containingBlock().computeCaretRect(line->selectionRect(), line->logicalLeft(), caretWidth, caretRectMode);
+    return line->containingBlock().computeCaretRect(line->selectionRect(), line->contentLogicalLeft(), caretWidth, caretRectMode);
 }
 
 IntRect RenderLineBreak::linesBoundingBox() const
@@ -214,7 +214,7 @@
     const RootInlineBox& rootBox = box->root();
 
     auto line = LayoutIntegration::LineIterator(&rootBox);
-    LayoutRect rect = rootBox.blockFlow().computeCaretRect(line->selectionRect(), line->logicalLeft(), 0);
+    LayoutRect rect = rootBox.blockFlow().computeCaretRect(line->selectionRect(), line->contentLogicalLeft(), 0);
 
     if (rootBox.isFirstAfterPageBreak()) {
         if (box->isHorizontal())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to