Changeset 224350 in webkit


Ignore:
Timestamp:
Nov 2, 2017 12:24:42 PM (6 years ago)
Author:
Alan Bujtas
Message:

LayoutState::m_next is really the ancestor state.
https://bugs.webkit.org/show_bug.cgi?id=179187
<rdar://problem/35319525>

Reviewed by Simon Fraser.

No change in functionality.

  • rendering/LayoutState.cpp:

(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::clearPaginationInformation):
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):

  • rendering/LayoutState.h:
  • rendering/RenderView.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224348 r224350  
     12017-11-02  Zalan Bujtas  <zalan@apple.com>
     2
     3        LayoutState::m_next is really the ancestor state.
     4        https://bugs.webkit.org/show_bug.cgi?id=179187
     5        <rdar://problem/35319525>
     6
     7        Reviewed by Simon Fraser.
     8
     9        No change in functionality.
     10
     11        * rendering/LayoutState.cpp:
     12        (WebCore::LayoutState::LayoutState):
     13        (WebCore::LayoutState::clearPaginationInformation):
     14        (WebCore::LayoutState::propagateLineGridInfo):
     15        (WebCore::LayoutState::establishLineGrid):
     16        * rendering/LayoutState.h:
     17        * rendering/RenderView.h:
     18
    1192017-11-02  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebCore/rendering/LayoutState.cpp

    r222575 r224350  
    3535namespace WebCore {
    3636
    37 LayoutState::LayoutState(std::unique_ptr<LayoutState> next, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
    38     : m_next(WTFMove(next))
     37LayoutState::LayoutState(std::unique_ptr<LayoutState> ancestor, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
     38    : m_ancestor(WTFMove(ancestor))
    3939#ifndef NDEBUG
    4040    , m_renderer(renderer)
    4141#endif
    4242{
    43     ASSERT(m_next);
     43    ASSERT(m_ancestor);
    4444
    4545    bool fixed = renderer->isOutOfFlowPositioned() && renderer->style().position() == FixedPosition;
     
    4949        m_paintOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset;
    5050    } else
    51         m_paintOffset = m_next->m_paintOffset + offset;
     51        m_paintOffset = m_ancestor->m_paintOffset + offset;
    5252
    5353    if (renderer->isOutOfFlowPositioned() && !fixed) {
     
    6363        m_paintOffset += renderer->layer()->offsetForInFlowPosition();
    6464
    65     m_clipped = !fixed && m_next->m_clipped;
     65    m_clipped = !fixed && m_ancestor->m_clipped;
    6666    if (m_clipped)
    67         m_clipRect = m_next->m_clipRect;
     67        m_clipRect = m_ancestor->m_clipRect;
    6868
    6969    if (renderer->hasOverflowClip()) {
     
    9090    } else {
    9191        // If we don't establish a new page height, then propagate the old page height and offset down.
    92         m_pageLogicalHeight = m_next->m_pageLogicalHeight;
    93         m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
    94         m_pageOffset = m_next->m_pageOffset;
     92        m_pageLogicalHeight = m_ancestor->m_pageLogicalHeight;
     93        m_pageLogicalHeightChanged = m_ancestor->m_pageLogicalHeightChanged;
     94        m_pageOffset = m_ancestor->m_pageOffset;
    9595       
    9696        // Disable pagination for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and
     
    106106    propagateLineGridInfo(renderer);
    107107
    108     m_layoutDelta = m_next->m_layoutDelta;
     108    m_layoutDelta = m_ancestor->m_layoutDelta;
    109109#if !ASSERT_DISABLED
    110     m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated;
    111     m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated;
     110    m_layoutDeltaXSaturated = m_ancestor->m_layoutDeltaXSaturated;
     111    m_layoutDeltaYSaturated = m_ancestor->m_layoutDeltaYSaturated;
    112112#endif
    113113
     
    149149void LayoutState::clearPaginationInformation()
    150150{
    151     m_pageLogicalHeight = m_next->m_pageLogicalHeight;
    152     m_pageOffset = m_next->m_pageOffset;
     151    m_pageLogicalHeight = m_ancestor->m_pageLogicalHeight;
     152    m_pageOffset = m_ancestor->m_pageOffset;
    153153}
    154154
     
    164164    // Disable line grids for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and
    165165    // writing mode roots.
    166     if (!m_next || renderer->isUnsplittableForPagination())
     166    if (!m_ancestor || renderer->isUnsplittableForPagination())
    167167        return;
    168168
    169     m_lineGrid = m_next->m_lineGrid;
    170     m_lineGridOffset = m_next->m_lineGridOffset;
    171     m_lineGridPaginationOrigin = m_next->m_lineGridPaginationOrigin;
     169    m_lineGrid = m_ancestor->m_lineGrid;
     170    m_lineGridOffset = m_ancestor->m_lineGridOffset;
     171    m_lineGridPaginationOrigin = m_ancestor->m_lineGridPaginationOrigin;
    172172}
    173173
     
    179179            return;
    180180        RenderBlockFlow* currentGrid = m_lineGrid;
    181         for (LayoutState* currentState = m_next.get(); currentState; currentState = currentState->m_next.get()) {
     181        for (LayoutState* currentState = m_ancestor.get(); currentState; currentState = currentState->m_ancestor.get()) {
    182182            if (currentState->m_lineGrid == currentGrid)
    183183                continue;
  • trunk/Source/WebCore/rendering/LayoutState.h

    r222575 r224350  
    5454    }
    5555
    56     LayoutState(std::unique_ptr<LayoutState>, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
     56    LayoutState(std::unique_ptr<LayoutState> ancestor, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
    5757    explicit LayoutState(RenderObject&);
    5858
     
    9898    // The current line grid that we're snapping to and the offset of the start of the grid.
    9999    RenderBlockFlow* m_lineGrid { nullptr };
    100     std::unique_ptr<LayoutState> m_next;
     100    std::unique_ptr<LayoutState> m_ancestor;
    101101
    102102    // FIXME: Distinguish between the layout clip rect and the paint clip rect which may be larger,
  • trunk/Source/WebCore/rendering/RenderView.h

    r224176 r224350  
    264264    void popLayoutState()
    265265    {
    266         m_layoutState = WTFMove(m_layoutState->m_next);
     266        m_layoutState = WTFMove(m_layoutState->m_ancestor);
    267267    }
    268268
Note: See TracChangeset for help on using the changeset viewer.