Title: [248365] trunk/Source/WebCore
Revision
248365
Author
[email protected]
Date
2019-08-07 08:32:55 -0700 (Wed, 07 Aug 2019)

Log Message

[LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
https://bugs.webkit.org/show_bug.cgi?id=200502
<rdar://problem/54032534>

Reviewed by Antti Koivisto.

The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
lay out the out-of-flow boxes that actually belong to the current formatting context.

<div style="float: left">
  <div id=outer style="position: absolute">
    <div id=inner style="position: absolute"></div>
  </div>
</div>

The float's formatting context only lays out the outer absolutely positioned box. The inner box
(which is also an out-of-flow descendant of the float box) is taken care of by the outer box.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (248364 => 248365)


--- trunk/Source/WebCore/ChangeLog	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/ChangeLog	2019-08-07 15:32:55 UTC (rev 248365)
@@ -1,5 +1,37 @@
 2019-08-07  Zalan Bujtas  <[email protected]>
 
+        [LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
+        https://bugs.webkit.org/show_bug.cgi?id=200502
+        <rdar://problem/54032534>
+
+        Reviewed by Antti Koivisto.
+
+        The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
+        lay out the out-of-flow boxes that actually belong to the current formatting context.
+
+        <div style="float: left">
+          <div id=outer style="position: absolute">
+            <div id=inner style="position: absolute"></div>
+          </div>
+        </div>
+
+        The float's formatting context only lays out the outer absolutely positioned box. The inner box
+        (which is also an out-of-flow descendant of the float box) is taken care of by the outer box.
+
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
+        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
+        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
+        * layout/FormattingContext.h:
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
+
+2019-08-07  Zalan Bujtas  <[email protected]>
+
         [LFC] Introduce Layout::Phase class
         https://bugs.webkit.org/show_bug.cgi?id=200473
         <rdar://problem/53996061>

Modified: trunk/Source/WebCore/layout/FormattingContext.cpp (248364 => 248365)


--- trunk/Source/WebCore/layout/FormattingContext.cpp	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/layout/FormattingContext.cpp	2019-08-07 15:32:55 UTC (rev 248365)
@@ -133,9 +133,9 @@
     displayBox.setPadding(Geometry::computedPadding(layoutBox, *usedValues));
 }
 
-void FormattingContext::layoutOutOfFlowDescendants() const
+void FormattingContext::layoutOutOfFlowContent() const
 {
-    LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: layout out-of-flow descendants -> context: " << &layoutState() << " root: " << &root());
+    LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: layout out-of-flow content -> context: " << &layoutState() << " root: " << &root());
 
     for (auto& outOfFlowBox : formattingState().outOfFlowBoxes()) {
         ASSERT(outOfFlowBox->establishesFormattingContext());
@@ -147,9 +147,9 @@
         formattingContext->layout();
 
         computeOutOfFlowVerticalGeometry(*outOfFlowBox);
-        formattingContext->layoutOutOfFlowDescendants();
+        formattingContext->layoutOutOfFlowContent();
     }
-    LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow descendants -> context: " << &layoutState() << " root: " << &root());
+    LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow content -> context: " << &layoutState() << " root: " << &root());
 }
 
 static LayoutUnit mapHorizontalPositionToAncestor(const LayoutState& layoutState, LayoutUnit horizontalPosition, const Container& containingBlock, const Container& ancestor)
@@ -239,8 +239,7 @@
         if ((layoutBox.isBlockLevelBox() || layoutBox.isOutOfFlowPositioned()) && !layoutBox.replaced()) {
             // margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right = width of containing block
             auto containingBlockWidth = containingBlockDisplayBox.contentBoxWidth();
-            ASSERT(displayBox.marginStart() + displayBox.borderLeft() + displayBox.paddingLeft().valueOr(0) + displayBox.contentBoxWidth()
-                + displayBox.paddingRight().valueOr(0) + displayBox.borderRight() + displayBox.marginEnd() == containingBlockWidth);
+            ASSERT(displayBox.horizontalMarginBorderAndPadding() + displayBox.contentBoxWidth() == containingBlockWidth);
         }
 
         // 10.6.4 Absolutely positioned, non-replaced elements

Modified: trunk/Source/WebCore/layout/FormattingContext.h (248364 => 248365)


--- trunk/Source/WebCore/layout/FormattingContext.h	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/layout/FormattingContext.h	2019-08-07 15:32:55 UTC (rev 248365)
@@ -50,7 +50,7 @@
     virtual ~FormattingContext();
 
     virtual void layout() const = 0;
-    void layoutOutOfFlowDescendants() const;
+    void layoutOutOfFlowContent() const;
 
     struct IntrinsicWidthConstraints {
         void expand(LayoutUnit horizontalValue);

Modified: trunk/Source/WebCore/layout/LayoutState.cpp (248364 => 248365)


--- trunk/Source/WebCore/layout/LayoutState.cpp	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/layout/LayoutState.cpp	2019-08-07 15:32:55 UTC (rev 248365)
@@ -85,7 +85,7 @@
     RELEASE_ASSERT(layoutRoot.establishesFormattingContext());
     auto formattingContext = createFormattingContext(layoutRoot);
     formattingContext->layout();
-    formattingContext->layoutOutOfFlowDescendants();
+    formattingContext->layoutOutOfFlowContent();
 }
 
 Display::Box& LayoutState::displayBoxForLayoutBox(const Box& layoutBox) const

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (248364 => 248365)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2019-08-07 15:32:55 UTC (rev 248365)
@@ -172,8 +172,8 @@
     // Come back and finalize the root's geometry.
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
     computeHeightAndMargin(layoutBox);
-    // Now that we computed the root's height, we can go back and layout the out-of-flow descedants (if any).
-    formattingContext->layoutOutOfFlowDescendants();
+    // Now that we computed the root's height, we can go back and layout the out-of-flow content.
+    formattingContext->layoutOutOfFlowContent();
 
     // Float related final positioning.
     if (layoutBox.isFloatingPositioned()) {

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (248364 => 248365)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2019-08-07 14:23:54 UTC (rev 248364)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2019-08-07 15:32:55 UTC (rev 248365)
@@ -248,8 +248,8 @@
     formattingContext->layout();
     // Come back and finalize the root's height and margin.
     computeHeightAndMargin(root);
-    // Now that we computed the root's height, we can go back and layout the out-of-flow descedants (if any).
-    formattingContext->layoutOutOfFlowDescendants();
+    // Now that we computed the root's height, we can go back and layout the out-of-flow content.
+    formattingContext->layoutOutOfFlowContent();
 }
 
 void InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox(const Box& layoutBox, UsedHorizontalValues usedValues) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to