Title: [114711] trunk/Source/WebCore
Revision
114711
Author
[email protected]
Date
2012-04-19 18:40:56 -0700 (Thu, 19 Apr 2012)

Log Message

computeNonFastScrollableRegion needs to traverse the entire frame tree
https://bugs.webkit.org/show_bug.cgi?id=84409
<rdar://problem/11285741>

Reviewed by Dan Bernstein.

Now that scrollable areas won't be in the set of scrollable areas unless they are actually scrollable, we need to look for scrollable
areas in the entire frame tree since there can be a scrollable frame that's a subframe of a non-scrollable frame for example.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::computeNonFastScrollableRegion):
Traverse the entire frame tree looking for scrollable areas. Also, remove the scrollability checks because scrollable areas will only be
in the set if they have scrollbars that are enabled.

(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinator::frameViewScrollableAreasDidChange):
computeNonFastScrollableRegion now takes the main frame.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114710 => 114711)


--- trunk/Source/WebCore/ChangeLog	2012-04-20 01:40:15 UTC (rev 114710)
+++ trunk/Source/WebCore/ChangeLog	2012-04-20 01:40:56 UTC (rev 114711)
@@ -1,5 +1,25 @@
 2012-04-19  Anders Carlsson  <[email protected]>
 
+        computeNonFastScrollableRegion needs to traverse the entire frame tree
+        https://bugs.webkit.org/show_bug.cgi?id=84409
+        <rdar://problem/11285741>
+
+        Reviewed by Dan Bernstein.
+
+        Now that scrollable areas won't be in the set of scrollable areas unless they are actually scrollable, we need to look for scrollable
+        areas in the entire frame tree since there can be a scrollable frame that's a subframe of a non-scrollable frame for example.
+
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::computeNonFastScrollableRegion):
+        Traverse the entire frame tree looking for scrollable areas. Also, remove the scrollability checks because scrollable areas will only be
+        in the set if they have scrollbars that are enabled.
+
+        (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::ScrollingCoordinator::frameViewScrollableAreasDidChange):
+        computeNonFastScrollableRegion now takes the main frame.
+
+2012-04-19  Anders Carlsson  <[email protected]>
+
         Focus ring on wikipedia gets blobs when you type
         https://bugs.webkit.org/show_bug.cgi?id=84407
         <rdar://problem/11011847>

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (114710 => 114711)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-04-20 01:40:15 UTC (rev 114710)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-04-20 01:40:56 UTC (rev 114711)
@@ -105,27 +105,21 @@
 #endif
 }
 
-static Region computeNonFastScrollableRegion(FrameView* frameView)
+static Region computeNonFastScrollableRegion(Frame* mainFrame)
 {
     Region nonFastScrollableRegion;
 
-    HashSet<FrameView*> childFrameViews;
-    for (HashSet<RefPtr<Widget> >::const_iterator it = frameView->children()->begin(), end = frameView->children()->end(); it != end; ++it) {
-        if ((*it)->isFrameView())
-            childFrameViews.add(static_cast<FrameView*>(it->get()));
-    }
-
-    if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
+    for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) {
+        FrameView* frameView = frame->view();
+        if (!frameView)
+            continue;
+        
+        const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas();
+        if (!scrollableAreas)
+            continue;
+    
         for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
             ScrollableArea* scrollableArea = *it;
-
-            // Check if this area can be scrolled at all.
-            // If this scrollable area is a frame view that itself has scrollable areas, then we need to add it to the region.
-            if ((!scrollableArea->horizontalScrollbar() || !scrollableArea->horizontalScrollbar()->enabled())
-                && (!scrollableArea->verticalScrollbar() || !scrollableArea->verticalScrollbar()->enabled())
-                && (!childFrameViews.contains(static_cast<FrameView*>(scrollableArea)) || !static_cast<FrameView*>(scrollableArea)->scrollableAreas()))
-                    continue;
-
             nonFastScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox());
         }
     }
@@ -141,7 +135,7 @@
     // Compute the region of the page that we can't do fast scrolling for. This currently includes
     // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
     // frame view whose layout was updated is not the main frame.
-    Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame()->view());
+    Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame());
     setNonFastScrollableRegion(nonFastScrollableRegion);
 
     if (!coordinatesScrollingForFrameView(frameView))
@@ -161,7 +155,7 @@
     ASSERT(isMainThread());
     ASSERT(m_page);
 
-    Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame()->view());
+    Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame());
     setNonFastScrollableRegion(nonFastScrollableRegion);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to