Title: [94777] trunk/Source/WebCore
Revision
94777
Author
jchaffr...@webkit.org
Date
2011-09-08 11:54:33 -0700 (Thu, 08 Sep 2011)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94776 => 94777)


--- trunk/Source/WebCore/ChangeLog	2011-09-08 18:53:02 UTC (rev 94776)
+++ trunk/Source/WebCore/ChangeLog	2011-09-08 18:54:33 UTC (rev 94777)
@@ -1,5 +1,28 @@
 2011-09-08  Julien Chaffraix  <jchaffr...@webkit.org>
 
+        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.
+
+2011-09-08  Julien Chaffraix  <jchaffr...@webkit.org>
+
         Factor out the code to get the first non-null RenderTableSection in RenderTable
         https://bugs.webkit.org/show_bug.cgi?id=66972
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (94776 => 94777)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-09-08 18:53:02 UTC (rev 94776)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-09-08 18:54:33 UTC (rev 94777)
@@ -334,8 +334,9 @@
     if (m_hasVisibleContent) {
         RenderView* view = renderer()->view();
         ASSERT(view);
-        // FIXME: Optimize using LayoutState and remove LayoutStateDisabler instantiation
-        // from updateScrollInfoAfterLayout().
+        // FIXME: LayoutState does not work with RenderLayers as there is not a 1-to-1
+        // mapping between them and the RenderObjects. It would be neat to enable
+        // LayoutState outside the layout() phase and use it here.
         ASSERT(!view->layoutStateEnabled());
 
         RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
@@ -2247,15 +2248,8 @@
         // to pull our scroll offsets back to the max (or push them up to the min).
         LayoutUnit newX = max<LayoutUnit>(0, min(scrollXOffset(), scrollWidth() - box->clientWidth()));
         LayoutUnit newY = max<LayoutUnit>(0, min(scrollYOffset(), scrollHeight() - box->clientHeight()));
-        if (newX != scrollXOffset() || newY != scrollYOffset()) {
-            RenderView* view = renderer()->view();
-            ASSERT(view);
-            // scrollToOffset() may call updateLayerPositions(), which doesn't work
-            // with LayoutState.
-            // FIXME: Remove the LayoutStateDisabler instantiation if the above changes.
-            LayoutStateDisabler layoutStateDisabler(view);
+        if (newX != scrollXOffset() || newY != scrollYOffset())
             scrollToOffset(newX, newY);
-        }
     }
 
     bool haveHorizontalBar = m_hBar;
@@ -2328,11 +2322,7 @@
         m_vBar->setProportion(clientHeight, m_scrollSize.height());
     }
  
-    RenderView* view = renderer()->view();
-    {
-        LayoutStateDisabler layoutStateDisabler(view);
-        scrollToOffset(scrollXOffset(), scrollYOffset());
-    }
+    scrollToOffset(scrollXOffset(), scrollYOffset());
 
     if (renderer()->node() && renderer()->document()->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))
         updateOverflowStatus(horizontalOverflow, verticalOverflow);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to