Mark more InlineBox member functions as const
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 21:38:04 +0000 (21:38 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Oct 2017 21:38:04 +0000 (21:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178217

Reviewed by Andy Estes.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
nits while I am here.
(WebCore::InlineBox::flipForWritingMode const): Mark as const.
(WebCore::InlineBox::locationIncludingFlipping): Deleted.
(WebCore::InlineBox::flipForWritingMode): Deleted.
* rendering/InlineBox.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@223260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h

index 80ae9b6..349b55d 100644 (file)
@@ -1,5 +1,20 @@
 2017-10-12  Daniel Bates  <dabates@apple.com>
 
+        Mark more InlineBox member functions as const
+        https://bugs.webkit.org/show_bug.cgi?id=178217
+
+        Reviewed by Andy Estes.
+
+        * rendering/InlineBox.cpp:
+        (WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
+        nits while I am here.
+        (WebCore::InlineBox::flipForWritingMode const): Mark as const.
+        (WebCore::InlineBox::locationIncludingFlipping): Deleted.
+        (WebCore::InlineBox::flipForWritingMode): Deleted.
+        * rendering/InlineBox.h:
+
+2017-10-12  Daniel Bates  <dabates@apple.com>
+
         Teach InlineTextBox::clampOffset() about combined text and hyphenation
         https://bugs.webkit.org/show_bug.cgi?id=178032
 
index 310260b..73ea5e2 100644 (file)
@@ -288,39 +288,38 @@ void InlineBox::clearKnownToHaveNoOverflow()
         parent()->clearKnownToHaveNoOverflow();
 }
 
-FloatPoint InlineBox::locationIncludingFlipping()
+FloatPoint InlineBox::locationIncludingFlipping() const
 {
     if (!m_renderer.style().isFlippedBlocksWritingMode())
-        return FloatPoint(x(), y());
+        return topLeft();
     RenderBlockFlow& block = root().blockFlow();
     if (block.style().isHorizontalWritingMode())
-        return FloatPoint(x(), block.height() - height() - y());
-    else
-        return FloatPoint(block.width() - width() - x(), y());
+        return { x(), block.height() - height() - y() };
+    return { block.width() - width() - x(), y() };
 }
 
-void InlineBox::flipForWritingMode(FloatRect& rect)
+void InlineBox::flipForWritingMode(FloatRect& rect) const
 {
     if (!m_renderer.style().isFlippedBlocksWritingMode())
         return;
     root().blockFlow().flipForWritingMode(rect);
 }
 
-FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point)
+FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point) const
 {
     if (!m_renderer.style().isFlippedBlocksWritingMode())
         return point;
     return root().blockFlow().flipForWritingMode(point);
 }
 
-void InlineBox::flipForWritingMode(LayoutRect& rect)
+void InlineBox::flipForWritingMode(LayoutRect& rect) const
 {
     if (!m_renderer.style().isFlippedBlocksWritingMode())
         return;
     root().blockFlow().flipForWritingMode(rect);
 }
 
-LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point)
+LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point) const
 {
     if (!m_renderer.style().isFlippedBlocksWritingMode())
         return point;
index 5bee869..ac0ac01 100644 (file)
@@ -254,11 +254,11 @@ public:
         return nullptr;
     }
 
-    FloatPoint locationIncludingFlipping();
-    void flipForWritingMode(FloatRect&);
-    FloatPoint flipForWritingMode(const FloatPoint&);
-    void flipForWritingMode(LayoutRect&);
-    LayoutPoint flipForWritingMode(const LayoutPoint&);
+    FloatPoint locationIncludingFlipping() const;
+    void flipForWritingMode(FloatRect&) const;
+    FloatPoint flipForWritingMode(const FloatPoint&) const;
+    void flipForWritingMode(LayoutRect&) const;
+    LayoutPoint flipForWritingMode(const LayoutPoint&) const;
 
     bool knownToHaveNoOverflow() const { return m_bitfields.knownToHaveNoOverflow(); }
     void clearKnownToHaveNoOverflow();