Changeset 94777 in webkit


Ignore:
Timestamp:
Sep 8, 2011 11:54:33 AM (13 years ago)
Author:
jchaffraix@webkit.org
Message:

Remove LayoutStateDisabler instances from RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=66896

Reviewed by Simon Fraser.

As part of r93614, scrollTo does not call updateLayerPositions anymore.
This means that we don't need to disable LayoutState from the scrolling code
in RenderLayer.

This change is covered by the existing tests.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateLayerPositions): Updated the comment
that was not accurate anymore. Also explained what is wrong with
LayoutState vs RenderLayer now. Note that the ASSERT is still
valid and will not trigger as the remaining calls to updateLayerPositions
are done *outside* layout() where LayoutState is not set (thus disabled).

(WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed
2 LayoutStateDisabler surrounding scrollToOffset.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r94776 r94777  
     12011-09-08  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Remove LayoutStateDisabler instances from RenderLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=66896
     5
     6        Reviewed by Simon Fraser.
     7
     8        As part of r93614, scrollTo does not call updateLayerPositions anymore.
     9        This means that we don't need to disable LayoutState from the scrolling code
     10        in RenderLayer.
     11
     12        This change is covered by the existing tests.
     13
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::RenderLayer::updateLayerPositions): Updated the comment
     16        that was not accurate anymore. Also explained what is wrong with
     17        LayoutState vs RenderLayer now. Note that the ASSERT is still
     18        valid and will not trigger as the remaining calls to updateLayerPositions
     19        are done *outside* layout() where LayoutState is not set (thus disabled).
     20
     21        (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed
     22        2 LayoutStateDisabler surrounding scrollToOffset.
     23
    1242011-09-08  Julien Chaffraix  <jchaffraix@webkit.org>
    225
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r94741 r94777  
    335335        RenderView* view = renderer()->view();
    336336        ASSERT(view);
    337         // FIXME: Optimize using LayoutState and remove LayoutStateDisabler instantiation
    338         // from updateScrollInfoAfterLayout().
     337        // FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1
     338        // mapping between them and the RenderObjects. It would be neat to enable
     339        // LayoutState outside the layout() phase and use it here.
    339340        ASSERT(!view->layoutStateEnabled());
    340341
     
    22482249        LayoutUnit newX = max<LayoutUnit>(0, min(scrollXOffset(), scrollWidth() - box->clientWidth()));
    22492250        LayoutUnit newY = max<LayoutUnit>(0, min(scrollYOffset(), scrollHeight() - box->clientHeight()));
    2250         if (newX != scrollXOffset() || newY != scrollYOffset()) {
    2251             RenderView* view = renderer()->view();
    2252             ASSERT(view);
    2253             // scrollToOffset() may call updateLayerPositions(), which doesn't work
    2254             // with LayoutState.
    2255             // FIXME: Remove the LayoutStateDisabler instantiation if the above changes.
    2256             LayoutStateDisabler layoutStateDisabler(view);
     2251        if (newX != scrollXOffset() || newY != scrollYOffset())
    22572252            scrollToOffset(newX, newY);
    2258         }
    22592253    }
    22602254
     
    23292323    }
    23302324 
    2331     RenderView* view = renderer()->view();
    2332     {
    2333         LayoutStateDisabler layoutStateDisabler(view);
    2334         scrollToOffset(scrollXOffset(), scrollYOffset());
    2335     }
     2325    scrollToOffset(scrollXOffset(), scrollYOffset());
    23362326
    23372327    if (renderer()->node() && renderer()->document()->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
Note: See TracChangeset for help on using the changeset viewer.