Commit e54bedc4 authored by andersca@apple.com's avatar andersca@apple.com

Re-land. The non-fast scrollable region is now always updated after layout,...

Re-land. The non-fast scrollable region is now always updated after layout, and frameViewScrollableAreasDidChange has been removed.

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):
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 973827bb
2012-04-20 Anders Carlsson <andersca@apple.com>
Re-land. The non-fast scrollable region is now always updated after layout, and frameViewScrollableAreasDidChange has been removed.
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):
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
2012-04-20 Adrienne Walker <enne@google.com>
[chromium] Clip TransparencyWin to prevent OOM from large Skia canvas
......@@ -105,27 +105,21 @@ bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView
#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()));
}
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;
if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
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 @@ void ScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
// 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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment