Title: [121443] trunk/Source/WebCore
Revision
121443
Author
[email protected]
Date
2012-06-28 11:08:46 -0700 (Thu, 28 Jun 2012)

Log Message

Change FrameView::scrollContentsFastPath to use m_fixedObjects
https://bugs.webkit.org/show_bug.cgi?id=90045

Reviewed by James Robinson.

FrameView now has a hash set of fixed-position objects, so use
that instead of RenderBlock::positionedObjects(); we'll avoid traversing
through absolutely positioned objects, and this will work better for sticky
positioning in future.

No behavior change, so no new tests.

* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsFastPath):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121442 => 121443)


--- trunk/Source/WebCore/ChangeLog	2012-06-28 18:06:09 UTC (rev 121442)
+++ trunk/Source/WebCore/ChangeLog	2012-06-28 18:08:46 UTC (rev 121443)
@@ -1,3 +1,20 @@
+2012-06-28  Simon Fraser  <[email protected]>
+
+        Change FrameView::scrollContentsFastPath to use m_fixedObjects
+        https://bugs.webkit.org/show_bug.cgi?id=90045
+
+        Reviewed by James Robinson.
+        
+        FrameView now has a hash set of fixed-position objects, so use
+        that instead of RenderBlock::positionedObjects(); we'll avoid traversing
+        through absolutely positioned objects, and this will work better for sticky
+        positioning in future.
+
+        No behavior change, so no new tests.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollContentsFastPath):
+
 2012-06-28  Tony Chang  <[email protected]>
 
         Split flex into flex-grow/flex-shrink/flex-basis

Modified: trunk/Source/WebCore/page/FrameView.cpp (121442 => 121443)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-06-28 18:06:09 UTC (rev 121442)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-06-28 18:08:46 UTC (rev 121443)
@@ -1440,11 +1440,7 @@
 
 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
-    RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
-    if (RenderView* root = rootRenderer(this))
-        positionedObjects = root->positionedObjects();
-
-    if (!positionedObjects || positionedObjects->isEmpty()) {
+    if (!m_fixedObjects || m_fixedObjects->isEmpty()) {
         hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
         return true;
     }
@@ -1453,18 +1449,23 @@
 
     // Get the rects of the fixed objects visible in the rectToScroll
     Region regionToUpdate;
-    RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
-    for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
-        RenderBox* renderBox = *it;
-        if (renderBox->style()->position() != FixedPosition)
+    FixedObjectSet::const_iterator end = m_fixedObjects->end();
+    for (FixedObjectSet::const_iterator it = m_fixedObjects->begin(); it != end; ++it) {
+        RenderObject* renderer = *it;
+        if (renderer->style()->position() != FixedPosition)
             continue;
 #if USE(ACCELERATED_COMPOSITING)
-        if (renderBox->isComposited())
+        if (renderer->isComposited())
             continue;
 #endif
+    
+        // Fixed items should always have layers.
+        ASSERT(renderer->hasLayer());
+        RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
+        
 #if ENABLE(CSS_FILTERS)
-        if (renderBox->layer() && renderBox->layer()->parent()) {
-            RenderBoxModelObject* renderer = renderBox->layer()->parent()->renderer();
+        if (layer->parent()) {
+            RenderBoxModelObject* renderer = layer->parent()->renderer();
             if (renderer->style()->hasFilterOutsets()) {
                 // If the fixed layer has a blur/drop-shadow filter applied on its parent, we cannot 
                 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page.
@@ -1472,7 +1473,7 @@
             }
         }
 #endif
-        IntRect updateRect = pixelSnappedIntRect(renderBox->layer()->repaintRectIncludingNonCompositingDescendants());
+        IntRect updateRect = pixelSnappedIntRect(layer->repaintRectIncludingNonCompositingDescendants());
         updateRect = contentsToRootView(updateRect);
         if (!isCompositedContentLayer && clipsRepaints())
             updateRect.intersect(rectToScroll);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to