Make it possible to test rubber-banding in overflow scroll
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2017 23:26:52 +0000 (23:26 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2017 23:26:52 +0000 (23:26 +0000)
commite577862ddeb70a9b4ac8e0f562990151211232d4
tree162cfe8540bc39d333164544722e82d6a90b1740
parent149af74c8d6ed70291f37fc0567a9c1ece4a9293
Make it possible to test rubber-banding in overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=179078

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/scrolling/unconstrained-scrollto.html

Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
(which replaces RenderLayer::ScrollOffsetClamping) to support it.

Flip the default from unclamped to clamped for various RenderLayer scrolling-related
functions, since most callers want clamped.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::scrollTo const):
* dom/Element.cpp:
(WebCore::Element::scrollTo):
* dom/Element.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* html/HTMLBodyElement.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::elementDidBlur):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollTo const):
* page/DOMWindow.h:
* page/Frame.cpp:
(WebCore::Frame::scrollOverflowLayer):
(WebCore::Frame::checkOverflowScroll):
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
* platform/ScrollAnimator.h:
* platform/ScrollTypes.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
* platform/ScrollableArea.h:
* platform/cocoa/ScrollController.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorMac::immediateScrollToPosition):
* platform/mock/ScrollAnimatorMock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::panScrollFromPoint):
(WebCore::RenderLayer::scrollByRecursively):
(WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::scrollToOffset):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::setScrollTop):
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::setScrollLeft):
(WebCore::RenderTextControlSingleLine::setScrollTop):
* rendering/RenderTextControlSingleLine.h:
* testing/Internals.cpp:
(WebCore::Internals::unconstrainedScrollTo):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKitLegacy/mac:

Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
(which replaces RenderLayer::ScrollOffsetClamping) to support it.

Flip the default from unclamped to clamped for various RenderLayer scrolling-related
functions, since most callers want clamped.

* DOM/DOMHTML.mm:
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):

LayoutTests:

Test that internals.unconstrainedScrollTo() works.

* fast/scrolling/unconstrained-scrollto-expected.txt: Added.
* fast/scrolling/unconstrained-scrollto.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/unconstrained-scrollto-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/unconstrained-scrollto.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/Frame.cpp
Source/WebCore/platform/ScrollAnimator.cpp
Source/WebCore/platform/ScrollAnimator.h
Source/WebCore/platform/ScrollTypes.h
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/cocoa/ScrollController.h
Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp
Source/WebCore/platform/gtk/ScrollAnimatorGtk.h
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mock/ScrollAnimatorMock.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListBox.h
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebCore/rendering/RenderMarquee.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMHTML.mm