[LFC] Rename LayoutPair to BoxPair
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 22:16:44 +0000 (22:16 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 22:16:44 +0000 (22:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189276

Reviewed by Antti Koivisto.

* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):

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

Source/WebCore/ChangeLog
Source/WebCore/layout/FormattingContext.h
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

index c526766..71e2dd0 100644 (file)
@@ -1,3 +1,14 @@
+2018-09-04  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Rename LayoutPair to BoxPair
+        https://bugs.webkit.org/show_bug.cgi?id=189276
+
+        Reviewed by Antti Koivisto.
+
+        * layout/FormattingContext.h:
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layout const):
+
 2018-09-04  Youenn Fablet  <youenn@apple.com>
 
         Disable WebRTC unified plan runtime flag by default
index 2d65206..11c7717 100644 (file)
@@ -64,11 +64,11 @@ public:
     static Position mapCoordinateToAncestor(const LayoutContext&, Position, const Container& containingBlock, const Container& ancestor);
 
 protected:
-    struct LayoutPair {
-        const Box& layoutBox;
-        Display::Box& displayBox;
+    struct BoxPair {
+        const Box& layout;
+        Display::Box& display;
     };
-    using LayoutQueue = Vector<std::unique_ptr<LayoutPair>>;
+    using LayoutQueue = Vector<std::unique_ptr<BoxPair>>;
 
     const Box& root() const { return *m_root; }
 
index a9cfca9..0f120cd 100644 (file)
@@ -66,7 +66,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat
     // This is a post-order tree traversal layout.
     // The root container layout is done in the formatting context it lives in, not that one it creates, so let's start with the first child.
     if (auto* firstChild = formattingRoot.firstInFlowOrFloatingChild())
-        layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*firstChild, layoutContext.createDisplayBox(*firstChild)}));
+        layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*firstChild, layoutContext.createDisplayBox(*firstChild)}));
     // 1. Go all the way down to the leaf node
     // 2. Compute static position and width as we traverse down
     // 3. As we climb back on the tree, compute height and finialize position
@@ -74,9 +74,9 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat
     while (!layoutQueue.isEmpty()) {
         // Traverse down on the descendants and compute width/static position until we find a leaf node.
         while (true) {
-            auto& layoutPair = *layoutQueue.last();
-            auto& layoutBox = layoutPair.layoutBox;
-            auto& displayBox = layoutPair.displayBox;
+            auto& boxPair = *layoutQueue.last();
+            auto& layoutBox = boxPair.layout;
+            auto& displayBox = boxPair.display;
 
             if (layoutBox.establishesFormattingContext()) {
                 layoutFormattingContextRoot(layoutContext, floatingContext, formattingState, layoutBox, displayBox);
@@ -86,7 +86,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat
                 if (!layoutBox.nextInFlowOrFloatingSibling())
                     break;
                 auto* nextSibling = layoutBox.nextInFlowOrFloatingSibling();
-                layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)}));
+                layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)}));
                 continue;
             }
 
@@ -97,15 +97,15 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat
             if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild())
                 break;
             auto& firstChild = *downcast<Container>(layoutBox).firstInFlowOrFloatingChild();
-            layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {firstChild, layoutContext.createDisplayBox(firstChild)}));
+            layoutQueue.append(std::make_unique<BoxPair>(BoxPair {firstChild, layoutContext.createDisplayBox(firstChild)}));
         }
 
         // Climb back on the ancestors and compute height/final position.
         while (!layoutQueue.isEmpty()) {
             // All inflow descendants (if there are any) are laid out by now. Let's compute the box's height.
-            auto layoutPair = layoutQueue.takeLast();
-            auto& layoutBox = layoutPair->layoutBox;
-            auto& displayBox = layoutPair->displayBox;
+            auto boxPair = layoutQueue.takeLast();
+            auto& layoutBox = boxPair->layout;
+            auto& displayBox = boxPair->display;
 
             LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
             // Formatting root boxes are special-cased and they don't come here.
@@ -120,7 +120,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat
             // Move in-flow positioned children to their final position.
             placeInFlowPositionedChildren(layoutContext, container);
             if (auto* nextSibling = container.nextInFlowOrFloatingSibling()) {
-                layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)}));
+                layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)}));
                 break;
             }
         }