Title: [250482] trunk/Source/WebCore
Revision
250482
Author
za...@apple.com
Date
2019-09-28 07:30:40 -0700 (Sat, 28 Sep 2019)

Log Message

[LFC][IFC] Line::Box should have a const public interface
https://bugs.webkit.org/show_bug.cgi?id=202336
<rdar://problem/55798628>

Reviewed by Antti Koivisto.

Clean up Line::Box interface.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::isVisuallyEmpty const):
(WebCore::Layout::Line::Run::expand):
(WebCore::Layout::Line::Run::displayRun): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250481 => 250482)


--- trunk/Source/WebCore/ChangeLog	2019-09-28 07:32:18 UTC (rev 250481)
+++ trunk/Source/WebCore/ChangeLog	2019-09-28 14:30:40 UTC (rev 250482)
@@ -1,3 +1,21 @@
+2019-09-28  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][IFC] Line::Box should have a const public interface
+        https://bugs.webkit.org/show_bug.cgi?id=202336
+        <rdar://problem/55798628>
+
+        Reviewed by Antti Koivisto.
+
+        Clean up Line::Box interface.
+
+        * layout/inlineformatting/InlineLine.cpp:
+        (WebCore::Layout::Line::close):
+        * layout/inlineformatting/InlineLine.h:
+        (WebCore::Layout::Line::Run::displayRun const):
+        (WebCore::Layout::Line::Run::isVisuallyEmpty const):
+        (WebCore::Layout::Line::Run::expand):
+        (WebCore::Layout::Line::Run::displayRun): Deleted.
+
 2019-09-27  Chris Dumez  <cdu...@apple.com>
 
         Pages using WebGLRenderingContext fail to enter the back/forward cache

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp (250481 => 250482)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2019-09-28 07:32:18 UTC (rev 250481)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2019-09-28 14:30:40 UTC (rev 250482)
@@ -178,10 +178,7 @@
         // Only text content can be extended atm.
         ASSERT(previousRun->isText());
         ASSERT(currentRun->isText());
-        auto& previousDisplayRun = previousRun->displayRun();
-        auto& currentDisplayRun = currentRun->displayRun();
-        previousDisplayRun.expandHorizontally(currentDisplayRun.logicalWidth());
-        previousDisplayRun.textContext()->expand(currentDisplayRun.textContext()->length());
+        previousRun->expand(*currentRun);
         m_runList.remove(index);
     }
     return WTFMove(m_runList);

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.h (250481 => 250482)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.h	2019-09-28 07:32:18 UTC (rev 250481)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.h	2019-09-28 14:30:40 UTC (rev 250482)
@@ -69,10 +69,10 @@
         Run(const InlineItem&, const Display::Run&);
 
         const Display::Run& displayRun() const { return m_displayRun; }
-        Display::Run& displayRun() { return m_displayRun; }
         const Box& layoutBox() const { return m_inlineItem.layoutBox(); }
 
         const Display::Rect& logicalRect() const { return m_displayRun.logicalRect(); }
+        bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
 
         bool isText() const { return m_inlineItem.isText(); }
         bool isBox() const { return m_inlineItem.isBox(); }
@@ -80,17 +80,19 @@
         bool isContainerStart() const { return m_inlineItem.isContainerStart(); }
         bool isContainerEnd() const { return m_inlineItem.isContainerEnd(); }
 
-        bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
-        bool isWhitespace() const;
-        bool canBeExtended() const;
-
     private:
         friend class Line;
         void adjustLogicalTop(LayoutUnit logicalTop) { m_displayRun.setLogicalTop(logicalTop); }
         void moveVertically(LayoutUnit offset) { m_displayRun.moveVertically(offset); }
         void moveHorizontally(LayoutUnit offset) { m_displayRun.moveHorizontally(offset); }
+
+        void expand(const Run&);
+
         void setVisuallyIsEmpty() { m_isVisuallyEmpty = true; }
 
+        bool isWhitespace() const;
+        bool canBeExtended() const;
+
         const InlineItem& m_inlineItem;
         Display::Run m_displayRun;
         bool m_isVisuallyEmpty { false };
@@ -141,6 +143,16 @@
     LineBox m_lineBox;
 };
 
+inline void Line::Run::expand(const Run& other)
+{
+    ASSERT(isText());
+    ASSERT(other.isText());
+
+    auto& otherDisplayRun = other.displayRun();
+    m_displayRun.expandHorizontally(otherDisplayRun.logicalWidth());
+    m_displayRun.textContext()->expand(otherDisplayRun.textContext()->length());
 }
+
 }
+}
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to