Compute the non-fast-scrollable region in main-document coordinates
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 00:46:40 +0000 (00:46 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 00:46:40 +0000 (00:46 +0000)
commit534989553f77af12b354e384a15f2f44aaa4b725
treec27314a199d21e0a259e8aee98852d4b3145fab5
parent7e77da42343242f48ac6df3da1319fc565793c25
Compute the non-fast-scrollable region in main-document coordinates
https://bugs.webkit.org/show_bug.cgi?id=144420

Reviewed by Tim Horton.

Source/WebCore:

Compute the non-fast-scrollable region in document coordinates, to make it easier
to reason about. Previously, it was document coordinates offset by top content inset.

* page/DebugPageOverlays.cpp:
(WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
event handler region, mapping each to root view coords, and then mapping back into document
coords at the end.
(WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
overlay and region are both document coordinates.
* page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects): Remove frame argument.
* page/Page.h:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::bounds):
(WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
view and overlay coordinates.
* page/PageOverlay.h:
* page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
(WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
recurses on frames, computing an absolute (document-relative) region per frame. This
removes the confusing offsetting through top content inset.
Change how we get to plugins that want wheel events; we can't get from PluginViewBase
to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
regions for transformed plugin-ins.
For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
then to our frame, then to our document.
(WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
the recursive function.
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
from view coordinates to document coordinates for testing against the non-fast region.
We previously assert that the root note is a FrameScrolling node.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
for the scrolling tree.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* testing/Internals.cpp:
(WebCore::Internals::nonFastScrollableRects): No need for frame arg.

LayoutTests:

We now report the non-fast region in document coordinates, so these two results change.

* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/DebugPageOverlays.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageOverlay.cpp
Source/WebCore/page/PageOverlay.h
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
Source/WebCore/testing/Internals.cpp