Changeset 248365 in webkit


Ignore:
Timestamp:
Aug 7, 2019 8:32:55 AM (5 years ago)
Author:
Alan Bujtas
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):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248364 r248365  
     12019-08-07  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
     4        https://bugs.webkit.org/show_bug.cgi?id=200502
     5        <rdar://problem/54032534>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
     10        lay out the out-of-flow boxes that actually belong to the current formatting context.
     11
     12        <div style="float: left">
     13          <div id=outer style="position: absolute">
     14            <div id=inner style="position: absolute"></div>
     15          </div>
     16        </div>
     17
     18        The float's formatting context only lays out the outer absolutely positioned box. The inner box
     19        (which is also an out-of-flow descendant of the float box) is taken care of by the outer box.
     20
     21        * layout/FormattingContext.cpp:
     22        (WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
     23        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
     24        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
     25        * layout/FormattingContext.h:
     26        * layout/LayoutState.cpp:
     27        (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
     28        * layout/blockformatting/BlockFormattingContext.cpp:
     29        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
     30        * layout/inlineformatting/InlineFormattingContext.cpp:
     31        (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
     32
    1332019-08-07  Zalan Bujtas  <zalan@apple.com>
    234
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r248290 r248365  
    134134}
    135135
    136 void FormattingContext::layoutOutOfFlowDescendants() const
    137 {
    138     LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: layout out-of-flow descendants -> context: " << &layoutState() << " root: " << &root());
     136void FormattingContext::layoutOutOfFlowContent() const
     137{
     138    LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: layout out-of-flow content -> context: " << &layoutState() << " root: " << &root());
    139139
    140140    for (auto& outOfFlowBox : formattingState().outOfFlowBoxes()) {
     
    148148
    149149        computeOutOfFlowVerticalGeometry(*outOfFlowBox);
    150         formattingContext->layoutOutOfFlowDescendants();
    151     }
    152     LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow descendants -> context: " << &layoutState() << " root: " << &root());
     150        formattingContext->layoutOutOfFlowContent();
     151    }
     152    LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow content -> context: " << &layoutState() << " root: " << &root());
    153153}
    154154
     
    240240            // margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right = width of containing block
    241241            auto containingBlockWidth = containingBlockDisplayBox.contentBoxWidth();
    242             ASSERT(displayBox.marginStart() + displayBox.borderLeft() + displayBox.paddingLeft().valueOr(0) + displayBox.contentBoxWidth()
    243                 + displayBox.paddingRight().valueOr(0) + displayBox.borderRight() + displayBox.marginEnd() == containingBlockWidth);
     242            ASSERT(displayBox.horizontalMarginBorderAndPadding() + displayBox.contentBoxWidth() == containingBlockWidth);
    244243        }
    245244
  • trunk/Source/WebCore/layout/FormattingContext.h

    r248290 r248365  
    5151
    5252    virtual void layout() const = 0;
    53     void layoutOutOfFlowDescendants() const;
     53    void layoutOutOfFlowContent() const;
    5454
    5555    struct IntrinsicWidthConstraints {
  • trunk/Source/WebCore/layout/LayoutState.cpp

    r248364 r248365  
    8686    auto formattingContext = createFormattingContext(layoutRoot);
    8787    formattingContext->layout();
    88     formattingContext->layoutOutOfFlowDescendants();
     88    formattingContext->layoutOutOfFlowContent();
    8989}
    9090
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

    r248290 r248365  
    173173    LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
    174174    computeHeightAndMargin(layoutBox);
    175     // Now that we computed the root's height, we can go back and layout the out-of-flow descedants (if any).
    176     formattingContext->layoutOutOfFlowDescendants();
     175    // Now that we computed the root's height, we can go back and layout the out-of-flow content.
     176    formattingContext->layoutOutOfFlowContent();
    177177
    178178    // Float related final positioning.
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r248290 r248365  
    249249    // Come back and finalize the root's height and margin.
    250250    computeHeightAndMargin(root);
    251     // Now that we computed the root's height, we can go back and layout the out-of-flow descedants (if any).
    252     formattingContext->layoutOutOfFlowDescendants();
     251    // Now that we computed the root's height, we can go back and layout the out-of-flow content.
     252    formattingContext->layoutOutOfFlowContent();
    253253}
    254254
Note: See TracChangeset for help on using the changeset viewer.