[iOS WK2] Make window.scroll() and window.scrollBy() work
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 20:31:35 +0000 (20:31 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 20:31:35 +0000 (20:31 +0000)
commitd8ce0dff2ab6ce10ec002918813e21c176aa239a
tree547c67615c0ca8077514015aea4d03dd06b0f0be
parent924d4300183d248f4409601e55abf7a99dad89e7
[iOS WK2] Make window.scroll() and window.scrollBy() work
https://bugs.webkit.org/show_bug.cgi?id=131848
<rdar://problem/16638319>

Reviewed by Beth Dakin.

The scrolling-related functions in DOMWindow were #ifdeffed for iOS
to use the hacky WK1-specific "actual scroll" functions, which do nothing
in WK2.

Fix by adding a scroll position wrapper (contentsScrollPosition) which does
the right thing on WK1 and WK2, and change almost all the places that used "actualScrollPosition"
to us it (with the exception of contentsScrollOffset() in MouseRelatedEvent.cpp, which has
confusing scaling behavior).

* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/TreeScope.cpp:
(WebCore::nodeFromPoint): Remove #ifdefs.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollX):
(WebCore::DOMWindow::scrollY):
(WebCore::DOMWindow::scrollBy):
(WebCore::DOMWindow::scrollTo):
* platform/ScrollView.cpp:
(WebCore::ScrollView::contentsScrollPosition):
(WebCore::ScrollView::setContentsScrollPosition):
* platform/ScrollView.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/MouseRelatedEvent.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h