Title: [134740] branches/safari-536.28-branch/Source/WebCore
Revision
134740
Author
simon.fra...@apple.com
Date
2012-11-14 22:13:56 -0800 (Wed, 14 Nov 2012)

Log Message

<rdar://problem/12705908> Scrolling some versions of the facebook page is very slow

Merge r134737

    2012-11-14  Simon Fraser  <simon.fra...@apple.com>

    Don't use temporary clip rects when hit testing
    https://bugs.webkit.org/show_bug.cgi?id=102329

    Reviewed by Beth Dakin.

    We now cache clip rects separately for painting, hit testing etc. Hit testing
    clip rects are always shrunk to exclude scrollbars (so that hit testing on
    the scrollbars works), so we no longer every need to use temporary clip rects
    during hit testing.

    Added an assertion that the scrollbar relevancy when we computed the clip rects
    is the same as that when using them.

    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::hitTestLayer):
    (WebCore::RenderLayer::updateClipRects):
    * rendering/RenderLayer.h:
    (WebCore::ClipRectsCache::ClipRectsCache):
    (ClipRectsCache):

Modified Paths

Diff

Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (134739 => 134740)


--- branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-15 06:11:11 UTC (rev 134739)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-15 06:13:56 UTC (rev 134740)
@@ -1,3 +1,31 @@
+2012-11-14  Simon Fraser  <simon.fra...@apple.com>
+
+        <rdar://problem/12705908> Scrolling some versions of the facebook page is very slow
+        
+        Merge r134737
+
+    2012-11-14  Simon Fraser  <simon.fra...@apple.com>
+    
+            Don't use temporary clip rects when hit testing
+            https://bugs.webkit.org/show_bug.cgi?id=102329
+    
+            Reviewed by Beth Dakin.
+    
+            We now cache clip rects separately for painting, hit testing etc. Hit testing
+            clip rects are always shrunk to exclude scrollbars (so that hit testing on
+            the scrollbars works), so we no longer every need to use temporary clip rects
+            during hit testing.
+    
+            Added an assertion that the scrollbar relevancy when we computed the clip rects
+            is the same as that when using them.
+            
+            * rendering/RenderLayer.cpp:
+            (WebCore::RenderLayer::hitTestLayer):
+            (WebCore::RenderLayer::updateClipRects):
+            * rendering/RenderLayer.h:
+            (WebCore::ClipRectsCache::ClipRectsCache):
+            (ClipRectsCache):
+
 2012-11-14  Timothy Hatcher  <timo...@apple.com>
 
         Merge r134100

Modified: branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.cpp (134739 => 134740)


--- branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.cpp	2012-11-15 06:11:11 UTC (rev 134739)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.cpp	2012-11-15 06:13:56 UTC (rev 134740)
@@ -3456,7 +3456,6 @@
 {
     // The natural thing would be to keep HitTestingTransformState on the stack, but it's big, so we heap-allocate.
 
-    bool useTemporaryClipRects = renderer()->view()->frameView()->containsScrollableAreaWithOverlayScrollbars();
 
     LayoutRect hitTestArea = result.rectForPoint(hitTestPoint);
 
@@ -3464,7 +3463,7 @@
     if (transform() && !appliedTransform) {
         // Make sure the parent's clip rects have been calculated.
         if (parent()) {
-            ClipRect clipRect = backgroundClipRect(rootLayer, result.region(), useTemporaryClipRects ? TemporaryClipRects : RootRelativeClipRects, IncludeOverlayScrollbarSize);
+            ClipRect clipRect = backgroundClipRect(rootLayer, result.region(), RootRelativeClipRects, IncludeOverlayScrollbarSize);
             // Go ahead and test the enclosing clip now.
             if (!clipRect.intersects(hitTestArea))
                 return 0;
@@ -3525,7 +3524,7 @@
     ClipRect bgRect;
     ClipRect fgRect;
     ClipRect outlineRect;
-    calculateRects(rootLayer, result.region(), useTemporaryClipRects ? TemporaryClipRects : RootRelativeClipRects, hitTestRect, layerBounds, bgRect, fgRect, outlineRect, 0, IncludeOverlayScrollbarSize);
+    calculateRects(rootLayer, result.region(), RootRelativeClipRects, hitTestRect, layerBounds, bgRect, fgRect, outlineRect, 0, IncludeOverlayScrollbarSize);
     
     // The following are used for keeping track of the z-depth of the hit point of 3d-transformed
     // descendants.
@@ -3801,6 +3800,7 @@
     ASSERT(clipRectsType < NumCachedClipRectsTypes);
     if (m_clipRectsCache && m_clipRectsCache->m_clipRects[clipRectsType]) {
         ASSERT(rootLayer == m_clipRectsCache->m_clipRectsRoot[clipRectsType]);
+        ASSERT(m_clipRectsCache->m_scrollbarRelevancy[clipRectsType] == relevancy);
         return; // We have the correct cached value.
     }
     
@@ -3823,6 +3823,7 @@
 
 #ifndef NDEBUG
     m_clipRectsCache->m_clipRectsRoot[clipRectsType] = rootLayer;
+    m_clipRectsCache->m_scrollbarRelevancy[clipRectsType] = relevancy;
 #endif
 }
 

Modified: branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.h (134739 => 134740)


--- branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.h	2012-11-15 06:11:11 UTC (rev 134739)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayer.h	2012-11-15 06:13:56 UTC (rev 134740)
@@ -227,14 +227,17 @@
     ClipRectsCache()
     {
 #ifndef NDEBUG
-        for (int i = 0; i < NumCachedClipRectsTypes; ++i)
+        for (int i = 0; i < NumCachedClipRectsTypes; ++i) {
             m_clipRectsRoot[i] = 0;
+            m_scrollbarRelevancy[i] = IgnoreOverlayScrollbarSize;
+        }
 #endif
     }
 
     RefPtr<ClipRects> m_clipRects[NumCachedClipRectsTypes];
 #ifndef NDEBUG
     const RenderLayer* m_clipRectsRoot[NumCachedClipRectsTypes];
+    OverlayScrollbarSizeRelevancy m_scrollbarRelevancy[NumCachedClipRectsTypes];
 #endif
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to