https://bugs.webkit.org/show_bug.cgi?id=127371
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jan 2014 19:25:25 +0000 (19:25 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jan 2014 19:25:25 +0000 (19:25 +0000)
commite02f2f0bb6e5b67acb82226eb0c8982244e75173
tree57ab096a35b2b1eb79701c346c6fd5320eed5926
parent6a1330ecd3f269907f1f61b30843c74dc1ea5544
https://bugs.webkit.org/show_bug.cgi?id=127371
Explore new API that could be used to help build infinitely scrolling websites
-and corresponding-
<rdar://problem/15244768>

Reviewed by Sam Weinig.

Source/WebCore:

This patch adds 4 new events called webkitwillrevealbottom, webkitwillrevealtop,
webkitwillrevealleft, and webkitwillrevealright. These events will fire when the
user has scrolled close to corresponding edge of the document. Right now that is
defined to be one viewport away from the corresponding edge.

FrameView::scrollPositionChanged() and
FrameView::scrollPositionChangedViaPlatformWidget() now take two parameters
representing the old scroll position and the new position.
* WebCore.exp.in:

New events.
* dom/Document.h:
* dom/Document.idl:
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::populateEventNameForAttributeLocalNameMap):
* page/DOMWindow.h:
* page/DOMWindow.idl:

Send oldPosition and newPosition to scrollPositionChanged().
* page/FrameView.cpp:
(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::scrollPositionChangedViaPlatformWidget):

After sending scroll events, also call sendWillRevealEdgeEventsIfNeeded() to send
the see if we should send the new will-reveal events.
(WebCore::FrameView::scrollPositionChanged):

Use the old position and the new position to determine if the events should be
sent.
(WebCore::FrameView::sendWillRevealEdgeEventsIfNeeded):

Send new parameters to scrollPositionChanged().
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
* page/FrameView.h:

Source/WebKit/mac:

FrameView::scrollPositionChangedViaPlatformWidget() now take two parameters
representing the old scroll position and the new position.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _frameOrBoundsChanged]):

LayoutTests:

* fast/events/will-reveal-edges-body-attributes-expected.txt: Added.
* fast/events/will-reveal-edges-body-attributes.html: Added.
* fast/events/will-reveal-edges-event-listeners-expected.txt: Added.
* fast/events/will-reveal-edges-event-listeners.html: Added.
* fast/events/will-reveal-edges-window-attributes-expected.txt: Added.
* fast/events/will-reveal-edges-window-attributes.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/will-reveal-edges-body-attributes-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/will-reveal-edges-body-attributes.html [new file with mode: 0644]
LayoutTests/fast/events/will-reveal-edges-event-listeners-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/will-reveal-edges-event-listeners.html [new file with mode: 0644]
LayoutTests/fast/events/will-reveal-edges-window-attributes-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/will-reveal-edges-window-attributes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/EventNames.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm