Changeset 151992 in webkit


Ignore:
Timestamp:
Jun 26, 2013 9:05:23 AM (11 years ago)
Author:
abucur@adobe.com
Message:

[CSS Regions] fast/regions/seamless-iframe-flowed-into-regions.html asserts
https://bugs.webkit.org/show_bug.cgi?id=117797

Reviewed by Antti Koivisto.

The seamless iframes inherit the current RenderFlowThread during layout. This means getting
the LayoutState object from the flow thread RenderView object is not always correct.
For RenderObjects inside the seamless iframes the view()/LayoutState object is different than the one
of the RenderFlowThread. The patch changes the code to use the correct LayoutState object during
layout when pushing a new state.

Tests: covered by fast/regions/seamless-iframe-flowed-into-regions.html

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::currentActiveRenderBox):
(WebCore::RenderFlowThread::pushFlowThreadLayoutState):
(WebCore::RenderFlowThread::popFlowThreadLayoutState):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151990 r151992  
     12013-06-26  Andrei Bucur  <abucur@adobe.com>
     2
     3        [CSS Regions] fast/regions/seamless-iframe-flowed-into-regions.html asserts
     4        https://bugs.webkit.org/show_bug.cgi?id=117797
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The seamless iframes inherit the current RenderFlowThread during layout. This means getting
     9        the LayoutState object from the flow thread RenderView object is not always correct.
     10        For RenderObjects inside the seamless iframes the view()/LayoutState object is different than the one
     11        of the RenderFlowThread. The patch changes the code to use the correct LayoutState object during
     12        layout when pushing a new state.
     13
     14        Tests: covered by fast/regions/seamless-iframe-flowed-into-regions.html
     15
     16        * rendering/RenderFlowThread.cpp:
     17        (WebCore::RenderFlowThread::currentActiveRenderBox):
     18        (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
     19        (WebCore::RenderFlowThread::popFlowThreadLayoutState):
     20
    1212013-06-26  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r151843 r151992  
    10381038const RenderBox* RenderFlowThread::currentActiveRenderBox() const
    10391039{
    1040     const RenderObject* currentObject = m_activeObjectsStack.isEmpty() ? 0 : m_activeObjectsStack.last();
    1041     if (currentObject && currentObject->isBox())
    1042         return toRenderBox(currentObject);
    1043 
    1044     return 0;
     1040    if (m_activeObjectsStack.isEmpty())
     1041        return 0;
     1042
     1043    const RenderObject* currentObject = m_activeObjectsStack.last();
     1044    return currentObject->isBox() ? toRenderBox(currentObject) : 0;
    10451045}
    10461046
    10471047void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject* object)
    10481048{
    1049     const RenderBox* currentBoxDescendant = currentActiveRenderBox();
    1050     LayoutState* layoutState = view()->layoutState();
    1051     if (currentBoxDescendant && layoutState && layoutState->isPaginated()) {
    1052         ASSERT(layoutState->m_renderer == currentBoxDescendant);
    1053         LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
    1054         setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width());
     1049    if (const RenderBox* currentBoxDescendant = currentActiveRenderBox()) {
     1050        LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
     1051        if (layoutState && layoutState->isPaginated()) {
     1052            ASSERT(layoutState->m_renderer == currentBoxDescendant);
     1053            LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
     1054            setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width());
     1055        }
    10551056    }
    10561057
     
    10621063    m_activeObjectsStack.removeLast();
    10631064
    1064     const RenderBox* currentBoxDescendant = currentActiveRenderBox();
    1065     LayoutState* layoutState = view()->layoutState();
    1066     if (currentBoxDescendant && layoutState && layoutState->isPaginated())
    1067         clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant);
     1065    if (const RenderBox* currentBoxDescendant = currentActiveRenderBox()) {
     1066        LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
     1067        if (layoutState && layoutState->isPaginated())
     1068            clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant);
     1069    }
    10681070}
    10691071
Note: See TracChangeset for help on using the changeset viewer.