Changeset 166631 in webkit


Ignore:
Timestamp:
Apr 1, 2014 10:36:54 PM (10 years ago)
Author:
abucur@adobe.com
Message:

[CSS Regions] Simplify the RenderFlowThread state pusher
https://bugs.webkit.org/show_bug.cgi?id=131035

Reviewed by David Hyatt.

The RenderFlowThread state pusher is desynchronized from the RenderView layout state pusher
by one renderer. This patch fixes the anomaly by correctly ordering the push and pop operations
between the two systems.

Tests: no functional change, no new tests.

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::pushFlowThreadLayoutState):
(WebCore::RenderFlowThread::popFlowThreadLayoutState):
(WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):

  • rendering/RenderView.cpp:

(WebCore::RenderView::pushLayoutState):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166630 r166631  
     12014-04-01  Andrei Bucur  <abucur@adobe.com>
     2
     3        [CSS Regions] Simplify the RenderFlowThread state pusher
     4        https://bugs.webkit.org/show_bug.cgi?id=131035
     5
     6        Reviewed by David Hyatt.
     7
     8        The RenderFlowThread state pusher is desynchronized from the RenderView layout state pusher
     9        by one renderer. This patch fixes the anomaly by correctly ordering the push and pop operations
     10        between the two systems.
     11
     12        Tests: no functional change, no new tests.
     13
     14        * rendering/RenderFlowThread.cpp:
     15        (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
     16        (WebCore::RenderFlowThread::popFlowThreadLayoutState):
     17        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
     18        * rendering/RenderView.cpp:
     19        (WebCore::RenderView::pushLayoutState):
     20        * rendering/RenderView.h:
     21
    1222014-04-01  Beth Dakin  <bdakin@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r166495 r166631  
    11451145void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject& object)
    11461146{
     1147    m_activeObjectsStack.add(&object);
     1148
    11471149    if (const RenderBox* currentBoxDescendant = currentActiveRenderBox()) {
    11481150        LayoutState* layoutState = currentBoxDescendant->view().layoutState();
     
    11531155        }
    11541156    }
    1155 
    1156     m_activeObjectsStack.add(&object);
    11571157}
    11581158
    11591159void RenderFlowThread::popFlowThreadLayoutState()
    11601160{
    1161     m_activeObjectsStack.removeLast();
    1162 
    11631161    if (const RenderBox* currentBoxDescendant = currentActiveRenderBox()) {
    11641162        LayoutState* layoutState = currentBoxDescendant->view().layoutState();
     
    11661164            clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant);
    11671165    }
     1166
     1167    m_activeObjectsStack.removeLast();
    11681168}
    11691169
     
    11741174    if (hasCachedOffsetFromLogicalTopOfFirstRegion(currentBlock))
    11751175        return cachedOffsetFromLogicalTopOfFirstRegion(currentBlock);
    1176 
    1177     // If it's the current box being laid out, use the layout state.
    1178     const RenderBox* currentBoxDescendant = currentActiveRenderBox();
    1179     if (currentBlock == currentBoxDescendant) {
    1180         LayoutState* layoutState = view().layoutState();
    1181         ASSERT(layoutState->m_renderer == currentBlock);
    1182         ASSERT(layoutState && layoutState->isPaginated());
    1183         LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
    1184         return currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
    1185     }
    11861176
    11871177    // As a last resort, take the slow path.
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r166489 r166631  
    10201020    ASSERT(m_layoutState == 0);
    10211021
     1022    m_layoutState = std::make_unique<LayoutState>(root);
    10221023    pushLayoutStateForCurrentFlowThread(root);
    1023     m_layoutState = std::make_unique<LayoutState>(root);
    10241024}
    10251025
  • trunk/Source/WebCore/rendering/RenderView.h

    r166489 r166631  
    254254        if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer.hasColumns() || renderer.flowThreadContainingBlock()
    255255            || m_layoutState->lineGrid() || (renderer.style().lineGrid() != RenderStyle::initialLineGrid() && renderer.isRenderBlockFlow())) {
     256            m_layoutState = std::make_unique<LayoutState>(std::move(m_layoutState), &renderer, offset, pageHeight, pageHeightChanged, colInfo);
    256257            pushLayoutStateForCurrentFlowThread(renderer);
    257             m_layoutState = std::make_unique<LayoutState>(std::move(m_layoutState), &renderer, offset, pageHeight, pageHeightChanged, colInfo);
    258258            return true;
    259259        }
     
    263263    void popLayoutState()
    264264    {
     265        popLayoutStateForCurrentFlowThread();
    265266        m_layoutState = std::move(m_layoutState->m_next);
    266         popLayoutStateForCurrentFlowThread();
    267267    }
    268268
Note: See TracChangeset for help on using the changeset viewer.