这是indexloc提供的服务,不要输入任何密码
| Differences between
and this patch
- a/Source/WebCore/ChangeLog +212 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2018-11-09  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch introduces a programmatic smooth scrolling in WebKit from the CSSOM View
9
        specification [1]. To use this effect, web developers can pass a behavior parameter (auto,
10
        smooth, or instant) to Element.scroll, Element.scrollTo, Element.scrollBy,
11
        Element.scrollIntoView, Window.scroll, Window.scrollTo or Window.scrollBy [2]. When behavior
12
        is auto, the instant/smooth characteristic is actually taken from the value of a new CSS
13
        scroll-behavior property [3]. Both the new CSS and DOM behavior are protected by a runtime
14
        flag. The Element.scrollIntoView part will be refined later in bug 189907. The actual
15
        animation of non-iOS platform relies on the existing ScrollAnimationSmooth.
16
        On iOS platform it is using UIScrollView scroll animation. The scroll position is synchronous
17
        from UI process to Web process.
18
19
        [1] https://drafts.csswg.org/cssom-view
20
        [2] https://drafts.csswg.org/cssom-view/#dictdef-scrolloptions
21
        [3] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
22
23
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
24
25
        Tests: imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
26
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
27
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
28
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
29
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
30
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
31
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
32
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
33
               fast/scrolling/ios/scroll-behavior-default-css.html
34
               fast/scrolling/ios/scroll-behavior-element.html
35
               fast/scrolling/ios/scroll-behavior-main-frame-root.html
36
               fast/scrolling/ios/scroll-behavior-main-frame-window.html
37
               fast/scrolling/ios/scroll-behavior-scrollintoview-nested.html
38
               fast/scrolling/ios/scroll-behavior-smooth-positions.html
39
               fast/scrolling/ios/scroll-behavior-subframe-root.html
40
               fast/scrolling/ios/scroll-behavior-subframe-window.html
41
42
        * CMakeLists.txt: Add IDL files for ScrollOptions and ScrollBehavior.
43
        * DerivedSources.make: Ditto.
44
        * Headers.cmake: Add headers for ScrollBehavor and ScrollOptions.
45
        * Sources.txt: Add ScrollBehavor and ScrollOptions implementation. Also build
46
        ScrollAnimationSmooth.cpp on all platforms.
47
        * SourcesGTK.txt: Remove ScrollAnimationSmooth.cpp since it is built on all platforms now.
48
        * WebCore.xcodeproj/project.pbxproj: Add files to the build system.
49
        * css/CSSComputedStyleDeclaration.cpp: Handle scroll-behavior.
50
        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
51
        * css/CSSProperties.json: Add scroll-behavior.
52
        * css/CSSValueKeywords.in: Add keywords for scroll-behavior.
53
        * css/parser/CSSParserContext.cpp: Add runtime config for scroll-behavior.
54
        (WebCore::CSSParserContext::CSSParserContext):
55
        (WebCore::operator==):
56
        * css/parser/CSSParserContext.h: Ditto.
57
        (WebCore::CSSParserContextHash::hash):
58
        * css/parser/CSSParserFastPaths.cpp: Remove scroll-behavior templates. It is handled in the
59
        slow path since property can be disabled.
60
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
61
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
62
        * css/parser/CSSPropertyParser.cpp:
63
        (WebCore::consumeScrollBehavior):
64
        (WebCore::CSSPropertyParser::parseSingleValue): Parse scroll-behavior (only if enabled).
65
        * dom/Element.cpp:
66
        (WebCore::Element::scrollIntoView): Pass scroll behavior, if any.
67
        (WebCore::Element::scrollBy):
68
        (WebCore::Element::scrollTo): Handle the case when scroll behavior is smooth.
69
        (WebCore::Element::setScrollLeft): Handle the case when scroll behavior is smooth.
70
        (WebCore::Element::setScrollTop): Handle the case when scroll behavior is smooth.
71
        * page/DOMWindow.cpp:
72
        (WebCore::DOMWindow::scrollBy const):
73
        (WebCore::DOMWindow::scrollTo const): Handle the case when scroll behavior is smooth. The optimization when scroll position is (0, 0) is skipped
74
        when a scroll is in progress, otherwise such a scroll can't be cancelled by a follow-up
75
        scroll.
76
        * page/FrameView.cpp:
77
        (WebCore::FrameView::scrollToOffsetWithAnimation): Start an animation for scrolling.
78
        * page/FrameView.h:
79
        * page/ScrollBehavior.cpp: Added.
80
        (WebCore::useSmoothScrolling): Helper funciton to determine the scroll behavior to apply to
81
        an element from the CSS and DOM behavior.
82
        * page/ScrollBehavior.h: Added.
83
        * page/ScrollBehavior.idl: Added.
84
        * page/ScrollIntoViewOptions.h: Make this class inherits from ScrollOption. Also remove
85
        unnecessary forward declaration.
86
        * page/ScrollIntoViewOptions.idl: Make this class inherits from ScrollOption.
87
        * page/ScrollOptions.h: Added.
88
        * page/ScrollOptions.idl: Added.
89
        * page/ScrollToOptions.h: Make this struct inherits from ScrollOptions.
90
        (WebCore::normalizeNonFiniteCoordinatesOrFallBackTo): Copy the current ScrollToOptions so
91
        that the scroll behavior is preserved.
92
        * page/ScrollToOptions.idl: Make this class inherit from ScrollOptions.
93
        * page/Settings.yaml: New setting for CSSOM View smooth scrolling.
94
        * page/scrolling/AsyncScrollingCoordinator.cpp:
95
        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): Add a flag to indicate if this is animation scroll or not.
96
        (WebCore::AsyncScrollingCoordinator::setScrollAnimationInProgress): Update the scroll animation status from UI side.
97
        * page/scrolling/AsyncScrollingCoordinator.h:
98
        * page/scrolling/ScrollingStateScrollingNode.cpp:
99
        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): Add m_requestedScrollPositionWithAnimation to indicate it's animated.
100
        (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition): Ditto.
101
        (WebCore::ScrollingStateScrollingNode::dumpProperties const): Ditto.
102
        * page/scrolling/ScrollingStateScrollingNode.h:
103
        (WebCore::ScrollingStateScrollingNode::requestedScrollPositionWithAnimation const): Ditto.
104
        * page/scrolling/ScrollingTree.h:
105
        (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll): Add withAnimation.
106
        (WebCore::ScrollingTree::scrollingTreeNodeIsScrollAnimationInProgressDidChange): Update scroll animation status.
107
        * page/scrolling/ScrollingTreeScrollingNode.cpp:
108
        (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
109
        (WebCore::ScrollingTreeScrollingNode::scrollTo): If needSyncScrollPosition is true, sync scroll position to Web side, even if scroll offset doesn't change.
110
        Maintain the status of m_stopScrollAnimation and m_requestScrollWithAnimation.
111
        (WebCore::ScrollingTreeScrollingNode::setRequestScrollWithAnimation): m_requestScrollWithAnimation indicates this is a animation scroll request.
112
        (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): Animation scroll won't change scoll position immediatelly, so don't notify scroll info.
113
        (WebCore::ScrollingTreeScrollingNode::setRequestScrollWithAnimation): Indicate this scroll request is animated or not.
114
        (WebCore::ScrollingTreeScrollingNode::requestScrollWithAnimation const): Ditto.
115
        (WebCore::ScrollingTreeScrollingNode::setScrollAnimationInProgress): Maintain scroll animation status.
116
        (WebCore::ScrollingTreeScrollingNode::scrollAnimationInProgress const): Ditto.
117
        (WebCore::ScrollingTreeScrollingNode::setNeedsStopCurrentScrollAnimation): If the Node is during scroll animation, the previous animation should stop first.
118
        (WebCore::ScrollingTreeScrollingNode::needsStopCurrentScrollAnimation const): Ditto.
119
        * page/scrolling/ScrollingTreeScrollingNode.h:
120
        * platform/ScrollAnimation.h:
121
        (WebCore::ScrollAnimation::scroll): Function to animate scrolling to a specified position.
122
        (WebCore::ScrollAnimation::isScrollInProgress const):
123
        * platform/ScrollAnimationKinetic.cpp:
124
        (WebCore::ScrollAnimationKinetic::isScrollInProgress const):
125
        * platform/ScrollAnimationKinetic.h:
126
        * platform/ScrollAnimationSmooth.cpp: Build this file on all platforms. Add a
127
        smoothFactorForProgrammaticScroll parameter to slow down the smooth scrolling.
128
        (WebCore::ScrollAnimationSmooth::scroll):
129
        (WebCore::ScrollAnimationSmooth::updatePerAxisData): Scale the time parameters of the
130
        animation so that it looks smoother.
131
        * platform/ScrollAnimationSmooth.h: Declare the class on all platforms.
132
        * platform/ScrollAnimator.cpp:
133
        (WebCore::ScrollAnimator::ScrollAnimator): Initialize animation member for programmatic scrolling.
134
        (WebCore::ScrollAnimator::isScrollInProgress const): For now, only claims scroll is in
135
        progress if smooth programmatic scroll is in progress.
136
        (WebCore::ScrollAnimator::scrollToOffset): Animate scrolling to the specified position.
137
        (WebCore::ScrollAnimator::cancelAnimations): Copy logic from ScrollAnimationSmooth.cpp.
138
        (WebCore::ScrollAnimator::serviceScrollAnimations): Ditto.
139
        (WebCore::ScrollAnimator::willEndLiveResize): Ditto.
140
        (WebCore::ScrollAnimator::didAddVerticalScrollbar): Ditto.
141
        (WebCore::ScrollAnimator::didAddHorizontalScrollbar): Ditto.
142
        * platform/ScrollAnimator.h: New animation member for smooth programmatic scrolling.
143
        * platform/ScrollTypes.h: Add ScrollBehaviorType to indicate it's instant or smooth scroll.
144
        Add ScrollBehaviorStatus to indicate the status of scroll.
145
        * platform/ScrollView.cpp:
146
        (WebCore::ScrollView::setScrollPosition): Follow the CSSOM View spec: If a scroll is in
147
        progress, we interrupt it and continue the scroll call (even when we are at the final
148
        position).
149
        * platform/ScrollableArea.cpp:
150
        (WebCore::ScrollableArea::ScrollableArea): Add m_currentScrollBehaviorType.
151
        (WebCore::ScrollableArea::isScrollInProgress): Helper function to check whether scroll
152
        animation is in progress on the animator. Using the m_currentScrollBehaviorStatus,
153
        if it's WebAnimationTimerStarted and m_scrollAnimator does not exist we don't construct it.
154
        (WebCore::ScrollableArea::isWebScrollAnimationInProgress): Check if the m_scrollAnimator of
155
        Web side is during a scroll animation.
156
        (WebCore::ScrollableArea::scrollToOffsetWithAnimation):
157
        (WebCore::ScrollableArea::setScrollOffsetFromInternals):
158
        (WebCore::ScrollableArea::setScrollOffsetFromAnimation): To void iterate calling,
159
        move the requestScrollPositionUpdate(position) checking out of setScrollOffsetFromAnimation().
160
        * platform/ScrollableArea.h:
161
        (WebCore::ScrollableArea::currentScrollBehaviorStatus const): Maintain currentScrollBehaviorStatus.
162
        (WebCore::ScrollableArea::setScrollBehaviorStatus):
163
        (WebCore::ScrollableArea::currentScrollBehaviorType const): Maintain currentScrollBehaviorType.
164
        (WebCore::ScrollableArea::setCurrentScrollBehaviorType):
165
        * platform/generic/ScrollAnimatorGeneric.cpp:
166
        (WebCore::ScrollAnimatorGeneric::updatePosition):
167
        * platform/mac/ScrollAnimatorMac.mm:
168
        (WebCore::ScrollAnimatorMac::cancelAnimations): Call parent member to handle programmatic scrolling.
169
        * rendering/RenderBox.cpp:
170
        (WebCore::RenderBox::setScrollLeft): Add flag to indicate animated or not.
171
        (WebCore::RenderBox::setScrollTop): Ditto.
172
        (WebCore::RenderBox::setScrollPosition):
173
        * rendering/RenderBox.h:
174
        * rendering/RenderLayer.cpp:
175
        (WebCore::RenderLayer::scrollToXPosition): Ditto.
176
        (WebCore::RenderLayer::scrollToYPosition): Ditto.
177
        (WebCore::RenderLayer::scrollToPosition):
178
        (WebCore::RenderLayer::scrollToOffset): Follow the CSSOM View spec: If a scroll is in
179
        progress, we interrupt it and continue the scroll call (even when we are at the final
180
        position). It's ScrollBehaviorType::Instant scroll.
181
        (WebCore::RenderLayer::requestScrollPositionUpdate):
182
        (WebCore::RenderLayer::scrollToOffsetWithAnimation): Ditto. This is similar to scrollToOffset
183
        but animates the scroll. It's ScrollBehaviorType::Smooth scroll.
184
        (WebCore::RenderLayer::scrollTo):
185
        (WebCore::RenderLayer::scrollRectToVisible): Again don't do an early return if scroll is in
186
        progress. We call scrollToOffsetWithAnimation instead of scrollToOffset when appropriate.
187
        Note that this function may not work well for several nested scroll boxes with at least one
188
        element with smooth behavior. It will handled in bug Follow.
189
        * rendering/RenderLayer.h: Add scroll behavior to ScrollTectToVisibleOptions.
190
        * rendering/RenderListBox.cpp:
191
        (WebCore::RenderListBox::setScrollLeft): Add animated flag.
192
        (WebCore::RenderListBox::setScrollTop): Ditto.
193
        * rendering/RenderListBox.h:
194
        * rendering/RenderObject.cpp:
195
        (WebCore::RenderObject::scrollRectToVisible):
196
        * rendering/RenderTextControlSingleLine.cpp:
197
        (WebCore::RenderTextControlSingleLine::setScrollLeft):
198
        (WebCore::RenderTextControlSingleLine::setScrollTop):
199
        * rendering/RenderTextControlSingleLine.h:
200
        * rendering/style/RenderStyle.h: Handle 'smooth scrolling' boolean data.
201
        (WebCore::RenderStyle::useSmoothScrolling const):
202
        (WebCore::RenderStyle::setUseSmoothScrolling):
203
        (WebCore::RenderStyle::initialUseSmoothScrolling):
204
        * rendering/style/StyleRareNonInheritedData.cpp: Ditto.
205
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
206
        (WebCore::StyleRareNonInheritedData::operator== const):
207
        * rendering/style/StyleRareNonInheritedData.h: Ditto.
208
        * style/StyleBuilderConverter.h:
209
        (WebCore::Style::BuilderConverter::convertSmoothScrolling):
210
        * testing/Internals.cpp:
211
        (WebCore::Internals::unconstrainedScrollTo):
212
1
2019-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
213
2019-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
2
214
3
        [css-grid] Avoid serializing [] in grid-template-* specified values
215
        [css-grid] Avoid serializing [] in grid-template-* specified values
- a/Source/WebKit/ChangeLog +53 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2019-11-28  Cathie Chen  <cathiechen@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add CSSOM smooth scrolling as an experimental feature.
9
10
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Deal with requestedScrollPositionWithAnimation encode and decode.
11
        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
12
        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
13
        (WebKit::dump):
14
        * Shared/WebPreferences.yaml:
15
        * UIProcess/API/Cocoa/WKWebView.mm:
16
        (pointsEqualInRoundToDevicePixel): Help function to check if two float points is not equal but it's same in device pixel.
17
        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:animated:]): Add animated to start a animated scroll.
18
        (-[WKWebView scrollViewDidEndScrollingAnimation:]): Send end sroll message to Web side.
19
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
20
        * UIProcess/PageClient.h:
21
        (WebKit::PageClient::requestScrollWithAnimation): Provide interface for animated scroll.
22
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
23
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Add animated flag.
24
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
25
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): Sync the scroll position to Web side.
26
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): Add animated scroll info to m_requestedScrollInfo.
27
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeIsScrollAnimationInProgressDidChange): Sync scrollAnimationInProgress to Web side.
28
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeRootNodeIsScrollAnimationInProgressDidChange): Ditto. For root node.
29
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
30
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
31
        (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): Add animated info.
32
        (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll): Ditto.
33
        (WebKit::RemoteScrollingTree::scrollingTreeNodeIsScrollAnimationInProgressDidChange): Ditto.
34
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
35
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
36
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
37
        (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Send scoll end info to Web side.
38
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): If scrollPosition of Web side isn't equal to UI side,
39
        the scroll position should be sync, even there's no scrolling in UI side.
40
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers): Calling the animated scroll interface.
41
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidEndScrollingAnimation): Sync scroll end info to web side.
42
        * UIProcess/WebPageProxy.cpp:
43
        (WebKit::WebPageProxy::requestScroll): To call different functions for smooth and instant scroll.
44
        * UIProcess/WebPageProxy.h:
45
        * UIProcess/ios/PageClientImplIOS.h:
46
        * UIProcess/ios/PageClientImplIOS.mm:
47
        (WebKit::PageClientImpl::requestScroll):
48
        (WebKit::PageClientImpl::requestScrollWithAnimation):
49
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
50
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in:
51
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
52
        (WebKit::RemoteScrollingCoordinator::scrollAnimationInProgressChangedForNode):
53
1
2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
54
2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2
55
3
        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release
56
        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release
- a/Source/WebKitLegacy/mac/ChangeLog +17 lines
Lines 1-3 a/Source/WebKitLegacy/mac/ChangeLog_sec1
1
2018-11-07  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * WebView/WebPreferenceKeysPrivate.h: Handle CSSOMViewSmoothScrolling by.
9
        * WebView/WebPreferences.mm:
10
        ([WebPreferences initialize]): Disable CSSOMViewSmoothScrolling by default.
11
        (-[WebPreferences CSSOMViewSmoothScrollingEnabled]): Getter.
12
        (-[WebPreferences setCSSOMViewSmoothScrollingEnabled:]): Setter.
13
        * WebView/WebPreferencesPrivate.h:
14
        * WebView/WebView.mm:
15
        (-[WebView _preferencesChanged:]):
16
17
1
2019-11-21  Daniel Bates  <dabates@apple.com>
18
2019-11-21  Daniel Bates  <dabates@apple.com>
2
19
3
        Remove unneeded code that annotated DOMHTMLElement as conforming to UITextInputTraits protocol
20
        Remove unneeded code that annotated DOMHTMLElement as conforming to UITextInputTraits protocol
- a/Source/WebKitLegacy/win/ChangeLog +17 lines
Lines 1-3 a/Source/WebKitLegacy/win/ChangeLog_sec1
1
2018-11-07  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * Interfaces/IWebPreferencesPrivate.idl: Handle smooth scrolling option.
9
        * WebPreferenceKeysPrivate.h: Ditto.
10
        * WebPreferences.cpp: Ditto.
11
        (WebPreferences::initializeDefaultSettings):
12
        (WebPreferences::CSSOMViewSmoothScrollingEnabled):
13
        (WebPreferences::setCSSOMViewSmoothScrollingEnabled):
14
        * WebPreferences.h: Ditto.
15
        * WebView.cpp: Ditto.
16
        (WebView::notifyPreferencesChanged):
17
1
2019-10-31  Ryosuke Niwa  <rniwa@webkit.org>
18
2019-10-31  Ryosuke Niwa  <rniwa@webkit.org>
2
19
3
        Windows build fix attempt after r251798.
20
        Windows build fix attempt after r251798.
- a/Source/WebCore/CMakeLists.txt +2 lines
Lines 958-965 set(WebCore_NON_SVG_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec1
958
    page/ResizeObserverCallback.idl
958
    page/ResizeObserverCallback.idl
959
    page/ResizeObserverEntry.idl
959
    page/ResizeObserverEntry.idl
960
    page/Screen.idl
960
    page/Screen.idl
961
    page/ScrollBehavior.idl
961
    page/ScrollIntoViewOptions.idl
962
    page/ScrollIntoViewOptions.idl
962
    page/ScrollLogicalPosition.idl
963
    page/ScrollLogicalPosition.idl
964
    page/ScrollOptions.idl
963
    page/ScrollToOptions.idl
965
    page/ScrollToOptions.idl
964
    page/ShareData.idl
966
    page/ShareData.idl
965
    page/UndoItem.idl
967
    page/UndoItem.idl
- a/Source/WebCore/DerivedSources.make +2 lines
Lines 912-919 JS_BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
912
    $(WebCore)/page/ResizeObserverCallback.idl \
912
    $(WebCore)/page/ResizeObserverCallback.idl \
913
    $(WebCore)/page/ResizeObserverEntry.idl \
913
    $(WebCore)/page/ResizeObserverEntry.idl \
914
    $(WebCore)/page/Screen.idl \
914
    $(WebCore)/page/Screen.idl \
915
    $(WebCore)/page/ScrollBehavior.idl \
915
    $(WebCore)/page/ScrollIntoViewOptions.idl \
916
    $(WebCore)/page/ScrollIntoViewOptions.idl \
916
    $(WebCore)/page/ScrollLogicalPosition.idl \
917
    $(WebCore)/page/ScrollLogicalPosition.idl \
918
    $(WebCore)/page/ScrollOptions.idl \
917
    $(WebCore)/page/ScrollToOptions.idl \
919
    $(WebCore)/page/ScrollToOptions.idl \
918
    $(WebCore)/page/ShareData.idl \
920
    $(WebCore)/page/ShareData.idl \
919
    $(WebCore)/page/UndoItem.idl \
921
    $(WebCore)/page/UndoItem.idl \
- a/Source/WebCore/Headers.cmake +2 lines
Lines 818-825 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec1
818
    page/RemoteFrame.h
818
    page/RemoteFrame.h
819
    page/RenderingUpdateScheduler.h
819
    page/RenderingUpdateScheduler.h
820
    page/RuntimeEnabledFeatures.h
820
    page/RuntimeEnabledFeatures.h
821
    page/ScrollBehavior.h
821
    page/ScrollIntoViewOptions.h
822
    page/ScrollIntoViewOptions.h
822
    page/ScrollLogicalPosition.h
823
    page/ScrollLogicalPosition.h
824
    page/ScrollOptions.h
823
    page/ScrollToOptions.h
825
    page/ScrollToOptions.h
824
    page/SecurityOrigin.h
826
    page/SecurityOrigin.h
825
    page/SecurityOriginData.h
827
    page/SecurityOriginData.h
- a/Source/WebCore/Sources.txt +4 lines
Lines 1641-1646 page/ResourceUsageOverlay.cpp a/Source/WebCore/Sources.txt_sec1
1641
page/ResourceUsageThread.cpp
1641
page/ResourceUsageThread.cpp
1642
page/RuntimeEnabledFeatures.cpp
1642
page/RuntimeEnabledFeatures.cpp
1643
page/Screen.cpp
1643
page/Screen.cpp
1644
page/ScrollBehavior.cpp
1644
page/SecurityOrigin.cpp
1645
page/SecurityOrigin.cpp
1645
page/SecurityOriginData.cpp
1646
page/SecurityOriginData.cpp
1646
page/SecurityPolicy.cpp
1647
page/SecurityPolicy.cpp
Lines 1746-1751 platform/RemoteCommandListener.cpp a/Source/WebCore/Sources.txt_sec2
1746
platform/RuntimeApplicationChecks.cpp
1747
platform/RuntimeApplicationChecks.cpp
1747
platform/SSLKeyGenerator.cpp
1748
platform/SSLKeyGenerator.cpp
1748
platform/ScrollAnimator.cpp
1749
platform/ScrollAnimator.cpp
1750
platform/ScrollAnimationSmooth.cpp
1749
platform/ScrollView.cpp
1751
platform/ScrollView.cpp
1750
platform/ScrollableArea.cpp
1752
platform/ScrollableArea.cpp
1751
platform/Scrollbar.cpp
1753
platform/Scrollbar.cpp
Lines 3369-3376 JSSVGZoomAndPan.cpp a/Source/WebCore/Sources.txt_sec3
3369
JSSVGZoomEvent.cpp
3371
JSSVGZoomEvent.cpp
3370
JSScreen.cpp
3372
JSScreen.cpp
3371
JSScriptProcessorNode.cpp
3373
JSScriptProcessorNode.cpp
3374
JSScrollBehavior.cpp
3372
JSScrollIntoViewOptions.cpp
3375
JSScrollIntoViewOptions.cpp
3373
JSScrollLogicalPosition.cpp
3376
JSScrollLogicalPosition.cpp
3377
JSScrollOptions.cpp
3374
JSScrollToOptions.cpp
3378
JSScrollToOptions.cpp
3375
JSSecurityPolicyViolationEvent.cpp
3379
JSSecurityPolicyViolationEvent.cpp
3376
JSServiceWorker.cpp
3380
JSServiceWorker.cpp
- a/Source/WebCore/SourcesGTK.txt -1 lines
Lines 63-69 page/scrolling/nicosia/ScrollingTreeStickyNode.cpp a/Source/WebCore/SourcesGTK.txt_sec1
63
page/scrolling/generic/ScrollingThreadGeneric.cpp
63
page/scrolling/generic/ScrollingThreadGeneric.cpp
64
64
65
platform/ScrollAnimationKinetic.cpp
65
platform/ScrollAnimationKinetic.cpp
66
platform/ScrollAnimationSmooth.cpp
67
platform/UserAgentQuirks.cpp
66
platform/UserAgentQuirks.cpp
68
67
69
platform/generic/ScrollAnimatorGeneric.cpp
68
platform/generic/ScrollAnimatorGeneric.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +26 lines
Lines 2389-2394 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
2389
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2389
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2390
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2390
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2391
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2391
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2392
		834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */; };
2393
		834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
2392
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2394
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2393
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2395
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2394
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
2396
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 2443-2448 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
2443
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2445
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2444
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2446
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2445
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2447
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2448
		83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356424 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
2449
		83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356435 /* ScrollOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2446
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2450
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2447
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2451
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2448
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
2452
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
Lines 10132-10140 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
10132
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10136
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10133
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10137
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10134
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10138
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10139
		8350C3E71DA59B6200356424 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
10140
		8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
10141
		8350C3E71DA59B6200356435 /* ScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollOptions.h; sourceTree = "<group>"; };
10135
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10142
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10136
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10143
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10137
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10144
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10145
		8350C3E81DA59B6200356424 /* ScrollBehavior.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollBehavior.idl; sourceTree = "<group>"; };
10146
		8350C3E81DA59B6200356435 /* ScrollOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollOptions.idl; sourceTree = "<group>"; };
10138
		8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
10147
		8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
10139
		83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
10148
		83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
10140
		835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
10149
		835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
Lines 10256-10264 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
10256
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10265
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10257
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10266
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10258
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10267
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10268
		83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollBehavior.cpp; sourceTree = "<group>"; };
10269
		83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollOptions.cpp; sourceTree = "<group>"; };
10259
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10270
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10260
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10271
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10261
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10272
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10273
		83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollBehavior.h; sourceTree = "<group>"; };
10274
		83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollOptions.h; sourceTree = "<group>"; };
10262
		83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
10275
		83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
10263
		83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
10276
		83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
10264
		83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
10277
		83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
Lines 20697-20706 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
20697
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20710
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20698
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20711
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20699
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20712
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20713
				8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */,
20714
				8350C3E71DA59B6200356424 /* ScrollBehavior.h */,
20715
				8350C3E81DA59B6200356424 /* ScrollBehavior.idl */,
20700
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20716
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20701
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20717
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20702
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20718
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20703
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20719
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20720
				8350C3E71DA59B6200356435 /* ScrollOptions.h */,
20721
				8350C3E81DA59B6200356435 /* ScrollOptions.idl */,
20704
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20722
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20705
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20723
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20706
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
20724
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
Lines 25484-25493 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
25484
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25502
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25485
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25503
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25486
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25504
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25505
				83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */,
25506
				83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */,
25487
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25507
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25488
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25508
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25489
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25509
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25490
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25510
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25511
				83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */,
25512
				83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */,
25491
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25513
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25492
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25514
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25493
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
25515
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
Lines 30818-30825 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
30818
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30840
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30819
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30841
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30820
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30842
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30843
				834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */,
30821
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30844
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30822
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30845
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30846
				834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */,
30823
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30847
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30824
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30848
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30825
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
30849
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
Lines 32016-32021 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
32016
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
32040
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
32017
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
32041
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
32018
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
32042
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
32043
				83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */,
32019
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
32044
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
32020
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
32045
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
32021
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
32046
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
Lines 32052-32057 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
32052
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
32077
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
32053
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
32078
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
32054
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
32079
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
32080
				83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */,
32055
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
32081
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
32056
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
32082
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
32057
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
32083
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +4 lines
Lines 3393-3398 RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
3393
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3393
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3394
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3394
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3395
#endif
3395
#endif
3396
        case CSSPropertyScrollBehavior:
3397
            if (!style.useSmoothScrolling())
3398
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3399
            return cssValuePool.createIdentifierValue(CSSValueSmooth);
3396
        case CSSPropertyPerspective:
3400
        case CSSPropertyPerspective:
3397
            if (!style.hasPerspective())
3401
            if (!style.hasPerspective())
3398
                return cssValuePool.createIdentifierValue(CSSValueNone);
3402
                return cssValuePool.createIdentifierValue(CSSValueNone);
- a/Source/WebCore/css/CSSProperties.json +26 lines
Lines 3557-3562 a/Source/WebCore/css/CSSProperties.json_sec1
3557
                "url": "https://www.w3.org/TR/SVG/shapes.html"
3557
                "url": "https://www.w3.org/TR/SVG/shapes.html"
3558
            }
3558
            }
3559
        },
3559
        },
3560
        "scroll-behavior": {
3561
            "values": [
3562
                "auto",
3563
                "smooth"
3564
            ],
3565
            "specification": {
3566
                "category": "cssom-view",
3567
                "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
3568
            }
3569
        },
3560
        "shape-rendering": {
3570
        "shape-rendering": {
3561
            "inherited": true,
3571
            "inherited": true,
3562
            "values": [
3572
            "values": [
Lines 6489-6494 a/Source/WebCore/css/CSSProperties.json_sec2
6489
                "url": "https://www.w3.org/TR/css-ui-4/#propdef-user-select"
6499
                "url": "https://www.w3.org/TR/css-ui-4/#propdef-user-select"
6490
            }
6500
            }
6491
        },
6501
        },
6502
        "scroll-behavior": {
6503
            "values": [
6504
                "auto",
6505
                "smooth"
6506
            ],
6507
            "codegen-properties": {
6508
                "converter": "SmoothScrolling",
6509
                "name-for-methods": "UseSmoothScrolling"
6510
            },
6511
            "status": {
6512
                "status": "experimental"
6513
            },
6514
            "specification": {
6515
                "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
6516
            }
6517
        },
6492
        "scroll-padding": {
6518
        "scroll-padding": {
6493
            "codegen-properties": {
6519
            "codegen-properties": {
6494
                "enable-if": "ENABLE_CSS_SCROLL_SNAP",
6520
                "enable-if": "ENABLE_CSS_SCROLL_SNAP",
- a/Source/WebCore/css/CSSValueKeywords.in +4 lines
Lines 1387-1392 pan-y a/Source/WebCore/css/CSSValueKeywords.in_sec1
1387
pinch-zoom
1387
pinch-zoom
1388
#endif
1388
#endif
1389
1389
1390
// scroll-behavior
1391
// auto
1392
smooth
1393
1390
// hanging-punctuation
1394
// hanging-punctuation
1391
allow-end
1395
allow-end
1392
first
1396
first
- a/Source/WebCore/css/parser/CSSParserContext.cpp +2 lines
Lines 75-80 CSSParserContext::CSSParserContext(const Document& document, const URL& sheetBas a/Source/WebCore/css/parser/CSSParserContext.cpp_sec1
75
    attachmentEnabled = RuntimeEnabledFeatures::sharedFeatures().attachmentElementEnabled();
75
    attachmentEnabled = RuntimeEnabledFeatures::sharedFeatures().attachmentElementEnabled();
76
#endif
76
#endif
77
    deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
77
    deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
78
    scrollBehaviorEnabled = document.settings().CSSOMViewSmoothScrollingEnabled();
78
    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
79
    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
79
}
80
}
80
81
Lines 99-104 bool operator==(const CSSParserContext& a, const CSSParserContext& b) a/Source/WebCore/css/parser/CSSParserContext.cpp_sec2
99
        && a.attachmentEnabled == b.attachmentEnabled
100
        && a.attachmentEnabled == b.attachmentEnabled
100
#endif
101
#endif
101
        && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
102
        && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
103
        && a.scrollBehaviorEnabled == b.scrollBehaviorEnabled
102
        && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
104
        && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
103
        && a.useSystemAppearance == b.useSystemAppearance;
105
        && a.useSystemAppearance == b.useSystemAppearance;
104
}
106
}
- a/Source/WebCore/css/parser/CSSParserContext.h -1 / +3 lines
Lines 65-70 public: a/Source/WebCore/css/parser/CSSParserContext.h_sec1
65
    bool attachmentEnabled { false };
65
    bool attachmentEnabled { false };
66
#endif
66
#endif
67
    bool deferredCSSParserEnabled { false };
67
    bool deferredCSSParserEnabled { false };
68
    bool scrollBehaviorEnabled { false };
68
    
69
    
69
    // This is only needed to support getMatchedCSSRules.
70
    // This is only needed to support getMatchedCSSRules.
70
    bool hasDocumentSecurityOrigin { false };
71
    bool hasDocumentSecurityOrigin { false };
Lines 116-122 struct CSSParserContextHash { a/Source/WebCore/css/parser/CSSParserContext.h_sec2
116
#if ENABLE(ATTACHMENT_ELEMENT)
117
#if ENABLE(ATTACHMENT_ELEMENT)
117
            & key.attachmentEnabled                         << 11
118
            & key.attachmentEnabled                         << 11
118
#endif
119
#endif
119
            & key.mode                                      << 12; // Keep this last.
120
            & key.scrollBehaviorEnabled                     << 12
121
            & key.mode                                      << 13; // Keep this last.
120
        hash ^= WTF::intHash(bits);
122
        hash ^= WTF::intHash(bits);
121
        return hash;
123
        return hash;
122
    }
124
    }
- a/Source/WebCore/css/parser/CSSParserFastPaths.cpp -5 lines
Lines 636-645 bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId a/Source/WebCore/css/parser/CSSParserFastPaths.cpp_sec1
636
            || valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
636
            || valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
637
    case CSSPropertyResize: // none | both | horizontal | vertical | auto
637
    case CSSPropertyResize: // none | both | horizontal | vertical | auto
638
        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
638
        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
639
    // FIXME-NEWPARSER: Investigate this property.
640
    // case CSSPropertyScrollBehavior: // auto | smooth
641
    //     ASSERT(RuntimeEnabledFeatures::cssomSmoothScrollEnabled());
642
    //   return valueID == CSSValueAuto || valueID == CSSValueSmooth;
643
    case CSSPropertyShapeRendering:
639
    case CSSPropertyShapeRendering:
644
        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
640
        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
645
    case CSSPropertyStrokeLinejoin:
641
    case CSSPropertyStrokeLinejoin:
Lines 939-945 bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId) a/Source/WebCore/css/parser/CSSParserFastPaths.cpp_sec2
939
    // case CSSPropertyFontKerning:
935
    // case CSSPropertyFontKerning:
940
    // case CSSPropertyHyphens:
936
    // case CSSPropertyHyphens:
941
    // case CSSPropertyOverflowAnchor:
937
    // case CSSPropertyOverflowAnchor:
942
    // case CSSPropertyScrollBehavior:
943
    // case CSSPropertyScrollSnapType:
938
    // case CSSPropertyScrollSnapType:
944
    // case CSSPropertyTextAlignLast:
939
    // case CSSPropertyTextAlignLast:
945
    // case CSSPropertyTextCombineUpright:
940
    // case CSSPropertyTextCombineUpright:
- a/Source/WebCore/css/parser/CSSPropertyParser.cpp +12 lines
Lines 2321-2326 static RefPtr<CSSValueList> consumeScrollSnapType(CSSParserTokenRange& range) a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec1
2321
2321
2322
#endif
2322
#endif
2323
2323
2324
static RefPtr<CSSPrimitiveValue> consumeScrollBehavior(CSSParserTokenRange& range)
2325
{
2326
    auto valueID = range.peek().id();
2327
    if (valueID != CSSValueAuto && valueID != CSSValueSmooth)
2328
        return nullptr;
2329
    return consumeIdent(range);
2330
}
2331
2324
static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
2332
static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
2325
{
2333
{
2326
    RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
2334
    RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
Lines 3920-3925 RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec2
3920
    case CSSPropertyScrollSnapType:
3928
    case CSSPropertyScrollSnapType:
3921
        return consumeScrollSnapType(m_range);
3929
        return consumeScrollSnapType(m_range);
3922
#endif
3930
#endif
3931
    case CSSPropertyScrollBehavior:
3932
        if (!m_context.scrollBehaviorEnabled)
3933
            return nullptr;
3934
        return consumeScrollBehavior(m_range);
3923
    case CSSPropertyClip:
3935
    case CSSPropertyClip:
3924
        return consumeClip(m_range, m_context.mode);
3936
        return consumeClip(m_range, m_context.mode);
3925
#if ENABLE(POINTER_EVENTS)
3937
#if ENABLE(POINTER_EVENTS)
- a/Source/WebCore/dom/Element.cpp -12 / +28 lines
Lines 832-838 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec1
832
    bool insideFixed;
832
    bool insideFixed;
833
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
833
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
834
834
835
    // FIXME(webkit.org/b/188043): Support ScrollBehavior.
836
    ScrollIntoViewOptions options;
835
    ScrollIntoViewOptions options;
837
    if (arg) {
836
    if (arg) {
838
        auto value = arg.value();
837
        auto value = arg.value();
Lines 851-857 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec2
851
        SelectionRevealMode::Reveal,
850
        SelectionRevealMode::Reveal,
852
        isHorizontal ? alignX : alignY,
851
        isHorizontal ? alignX : alignY,
853
        isHorizontal ? alignY : alignX,
852
        isHorizontal ? alignY : alignX,
854
        ShouldAllowCrossOriginScrolling::No
853
        ShouldAllowCrossOriginScrolling::No,
854
        options.behavior.valueOr(ScrollBehavior::Auto)
855
    };
855
    };
856
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, visibleOptions);
856
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, visibleOptions);
857
}
857
}
Lines 912-918 void Element::scrollBy(const ScrollToOptions& options) a/Source/WebCore/dom/Element.cpp_sec3
912
912
913
void Element::scrollBy(double x, double y)
913
void Element::scrollBy(double x, double y)
914
{
914
{
915
    scrollBy({ x, y });
915
    scrollBy(ScrollToOptions(x, y));
916
}
916
}
917
917
918
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
918
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
Lines 948-960 void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) a/Source/WebCore/dom/Element.cpp_sec4
948
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
948
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
949
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
949
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
950
    );
950
    );
951
    renderer->setScrollLeft(clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
951
    IntPoint scrollPosition(
952
    renderer->setScrollTop(clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
952
        clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()),
953
        clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom())
954
    );
955
    bool animated = useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *this);
956
    renderer->setScrollPosition(scrollPosition, ScrollType::Programmatic, animated, clamping);
953
}
957
}
954
958
955
void Element::scrollTo(double x, double y)
959
void Element::scrollTo(double x, double y)
956
{
960
{
957
    scrollTo({ x, y });
961
    scrollTo(ScrollToOptions(x, y));
958
}
962
}
959
963
960
void Element::scrollByUnits(int units, ScrollGranularity granularity)
964
void Element::scrollByUnits(int units, ScrollGranularity granularity)
Lines 1288-1300 void Element::setScrollLeft(int newLeft) a/Source/WebCore/dom/Element.cpp_sec5
1288
    document().updateLayoutIgnorePendingStylesheets();
1292
    document().updateLayoutIgnorePendingStylesheets();
1289
1293
1290
    if (document().scrollingElement() == this) {
1294
    if (document().scrollingElement() == this) {
1291
        if (auto* frame = documentFrameWithNonNullView())
1295
        if (auto* frame = documentFrameWithNonNullView()) {
1292
            frame->view()->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), frame->view()->scrollY()));
1296
            // FIXME: Should we use document()->scrollingElement()?
1297
            // See https://github.com/w3c/csswg-drafts/issues/2977
1298
            bool animated = document().documentElement() && useSmoothScrolling(ScrollBehavior::Auto, *document().documentElement());
1299
            frame->view()->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), frame->view()->scrollY()), animated);
1300
        }
1293
        return;
1301
        return;
1294
    }
1302
    }
1295
1303
1296
    if (auto* renderer = renderBox()) {
1304
    if (auto* renderer = renderBox()) {
1297
        renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1305
        int effectiveLeft = clampToInteger(newLeft * renderer->style().effectiveZoom());
1306
        bool animated = useSmoothScrolling(ScrollBehavior::Auto, *this);
1307
        renderer->setScrollLeft(effectiveLeft, ScrollType::Programmatic, animated, ScrollClamping::Clamped);
1298
        if (auto* scrollableArea = renderer->layer())
1308
        if (auto* scrollableArea = renderer->layer())
1299
            scrollableArea->setScrollShouldClearLatchedState(true);
1309
            scrollableArea->setScrollShouldClearLatchedState(true);
1300
    }
1310
    }
Lines 1305-1317 void Element::setScrollTop(int newTop) a/Source/WebCore/dom/Element.cpp_sec6
1305
    document().updateLayoutIgnorePendingStylesheets();
1315
    document().updateLayoutIgnorePendingStylesheets();
1306
1316
1307
    if (document().scrollingElement() == this) {
1317
    if (document().scrollingElement() == this) {
1308
        if (auto* frame = documentFrameWithNonNullView())
1318
        if (auto* frame = documentFrameWithNonNullView()) {
1309
            frame->view()->setScrollPosition(IntPoint(frame->view()->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor() * frame->frameScaleFactor())));
1319
            // FIXME: Should we use document()->scrollingElement()?
1320
            // See https://github.com/w3c/csswg-drafts/issues/2977
1321
            bool animated = document().documentElement() && useSmoothScrolling(ScrollBehavior::Auto, *document().documentElement());
1322
            frame->view()->setScrollPosition(IntPoint(frame->view()->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor() * frame->frameScaleFactor())), animated);
1323
        }
1310
        return;
1324
        return;
1311
    }
1325
    }
1312
1326
1313
    if (auto* renderer = renderBox()) {
1327
    if (auto* renderer = renderBox()) {
1314
        renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1328
        int effectiveTop = clampToInteger(newTop * renderer->style().effectiveZoom());
1329
        bool animated = useSmoothScrolling(ScrollBehavior::Auto, *this);
1330
        renderer->setScrollTop(effectiveTop, ScrollType::Programmatic, animated, ScrollClamping::Clamped);
1315
        if (auto* scrollableArea = renderer->layer())
1331
        if (auto* scrollableArea = renderer->layer())
1316
            scrollableArea->setScrollShouldClearLatchedState(true);
1332
            scrollableArea->setScrollShouldClearLatchedState(true);
1317
    }
1333
    }
- a/Source/WebCore/page/DOMWindow.cpp -4 / +12 lines
Lines 1595-1601 double DOMWindow::devicePixelRatio() const a/Source/WebCore/page/DOMWindow.cpp_sec1
1595
1595
1596
void DOMWindow::scrollBy(double x, double y) const
1596
void DOMWindow::scrollBy(double x, double y) const
1597
{
1597
{
1598
    scrollBy({ x, y });
1598
    scrollBy(ScrollToOptions(x, y));
1599
}
1599
}
1600
1600
1601
void DOMWindow::scrollBy(const ScrollToOptions& options) const
1601
void DOMWindow::scrollBy(const ScrollToOptions& options) const
Lines 1617-1626 void DOMWindow::scrollBy(const ScrollToOptions& options) const a/Source/WebCore/page/DOMWindow.cpp_sec2
1617
1617
1618
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1618
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1619
{
1619
{
1620
    scrollTo({ x, y }, clamping);
1620
    scrollTo(ScrollToOptions(x, y), clamping);
1621
}
1621
}
1622
1622
1623
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const
1623
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) const
1624
{
1624
{
1625
    if (!isCurrentlyDisplayedInFrame())
1625
    if (!isCurrentlyDisplayedInFrame())
1626
        return;
1626
        return;
Lines 1633-1644 void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const a/Source/WebCore/page/DOMWindow.cpp_sec3
1633
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1633
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1634
    );
1634
    );
1635
1635
1636
    if (!scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1636
    if (!view->isScrollInProgress() && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1637
        return;
1637
        return;
1638
1638
1639
    document()->updateLayoutIgnorePendingStylesheets();
1639
    document()->updateLayoutIgnorePendingStylesheets();
1640
1640
1641
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1641
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1642
1643
    // FIXME: Should we use document()->scrollingElement()?
1644
    // See https://github.com/w3c/csswg-drafts/issues/2977
1645
    if (document()->documentElement() && useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *document()->documentElement())) {
1646
        view->scrollToOffsetWithAnimation(layoutPos, ScrollType::Programmatic, clamping);
1647
        return;
1648
    }
1649
1642
    view->setContentsScrollPosition(layoutPos);
1650
    view->setContentsScrollPosition(layoutPos);
1643
}
1651
}
1644
1652
- a/Source/WebCore/page/FrameView.cpp -2 / +25 lines
Lines 2267-2273 void FrameView::scrollElementToRect(const Element& element, const IntRect& rect) a/Source/WebCore/page/FrameView.cpp_sec1
2267
    setScrollPosition(IntPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
2267
    setScrollPosition(IntPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
2268
}
2268
}
2269
2269
2270
void FrameView::setScrollPosition(const ScrollPosition& scrollPosition)
2270
void FrameView::setScrollPosition(const ScrollPosition& scrollPosition, bool animated)
2271
{
2271
{
2272
    LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " , clearing anchor");
2272
    LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " , clearing anchor");
2273
2273
Lines 2280-2286 void FrameView::setScrollPosition(const ScrollPosition& scrollPosition) a/Source/WebCore/page/FrameView.cpp_sec2
2280
    Page* page = frame().page();
2280
    Page* page = frame().page();
2281
    if (page && page->isMonitoringWheelEvents())
2281
    if (page && page->isMonitoringWheelEvents())
2282
        scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
2282
        scrollAnimator().setWheelEventTestMonitor(page->wheelEventTestMonitor());
2283
    ScrollView::setScrollPosition(scrollPosition);
2283
    if (animated)
2284
        scrollToOffsetWithAnimation(scrollOffsetFromPosition(scrollPosition), ScrollType::Programmatic);
2285
    else
2286
        ScrollView::setScrollPosition(scrollPosition);
2284
2287
2285
    setCurrentScrollType(oldScrollType);
2288
    setCurrentScrollType(oldScrollType);
2286
}
2289
}
Lines 3648-3653 void FrameView::scrollTo(const ScrollPosition& newPosition) a/Source/WebCore/page/FrameView.cpp_sec3
3648
    didChangeScrollOffset();
3651
    didChangeScrollOffset();
3649
}
3652
}
3650
3653
3654
void FrameView::scrollToOffsetWithAnimation(const ScrollOffset& offset, ScrollType scrollType, ScrollClamping)
3655
{
3656
    auto previousScrollType = currentScrollType();
3657
    setCurrentScrollType(scrollType);
3658
3659
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
3660
    setCurrentScrollBehaviorType(ScrollBehaviorType::Smooth);
3661
    if (requestScrollPositionUpdate(scrollPositionFromOffset(offset))) {
3662
        setCurrentScrollType(previousScrollType);
3663
        return;
3664
    }
3665
#endif
3666
3667
    if (isWebScrollAnimationInProgress())
3668
        scrollAnimator().cancelAnimations();
3669
    if (offset != this->scrollOffset())
3670
        ScrollableArea::scrollToOffsetWithAnimation(offset);
3671
    setCurrentScrollType(previousScrollType);
3672
}
3673
3651
float FrameView::adjustScrollStepForFixedContent(float step, ScrollbarOrientation orientation, ScrollGranularity granularity)
3674
float FrameView::adjustScrollStepForFixedContent(float step, ScrollbarOrientation orientation, ScrollGranularity granularity)
3652
{
3675
{
3653
    if (granularity != ScrollByPage || orientation == HorizontalScrollbar)
3676
    if (granularity != ScrollByPage || orientation == HorizontalScrollbar)
- a/Source/WebCore/page/FrameView.h -1 / +3 lines
Lines 222-228 public: a/Source/WebCore/page/FrameView.h_sec1
222
#if USE(COORDINATED_GRAPHICS)
222
#if USE(COORDINATED_GRAPHICS)
223
    WEBCORE_EXPORT void setFixedVisibleContentRect(const IntRect&) final;
223
    WEBCORE_EXPORT void setFixedVisibleContentRect(const IntRect&) final;
224
#endif
224
#endif
225
    WEBCORE_EXPORT void setScrollPosition(const ScrollPosition&) final;
225
    WEBCORE_EXPORT void setScrollPosition(const ScrollPosition&, bool animated = false) final;
226
    void restoreScrollbar();
226
    void restoreScrollbar();
227
    void scheduleScrollToFocusedElement(SelectionRevealMode);
227
    void scheduleScrollToFocusedElement(SelectionRevealMode);
228
    void scrollToFocusedElementImmediatelyIfNeeded();
228
    void scrollToFocusedElementImmediatelyIfNeeded();
Lines 658-663 public: a/Source/WebCore/page/FrameView.h_sec2
658
658
659
    void renderLayerDidScroll(const RenderLayer&);
659
    void renderLayerDidScroll(const RenderLayer&);
660
660
661
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
662
661
protected:
663
protected:
662
    bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
664
    bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final;
663
    void scrollContentsSlowPath(const IntRect& updateRect) final;
665
    void scrollContentsSlowPath(const IntRect& updateRect) final;
- a/Source/WebCore/page/ScrollBehavior.cpp +54 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.cpp_sec1
1
/*
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "ScrollBehavior.h"
28
29
#include "Element.h"
30
#include "RenderElement.h"
31
#include "RenderStyle.h"
32
#include "Settings.h"
33
34
namespace WebCore {
35
36
bool useSmoothScrolling(ScrollBehavior behavior, Element& associatedElement)
37
{
38
    if (!associatedElement.document().settings().CSSOMViewSmoothScrollingEnabled() || !associatedElement.renderer())
39
        return false;
40
41
    // https://drafts.csswg.org/cssom-view/#scrolling
42
    switch (behavior) {
43
    case ScrollBehavior::Auto:
44
        return associatedElement.renderer()->style().useSmoothScrolling();
45
    case ScrollBehavior::Instant:
46
        return false;
47
    case ScrollBehavior::Smooth:
48
        return true;
49
    }
50
    ASSERT_NOT_REACHED();
51
    return false;
52
}
53
54
} // namespace WebCore
- a/Source/WebCore/page/ScrollBehavior.h +40 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.h_sec1
1
/*
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
namespace WebCore {
29
30
class Element;
31
32
enum class ScrollBehavior : uint8_t {
33
    Auto = 0,
34
    Instant,
35
    Smooth
36
};
37
38
bool useSmoothScrolling(ScrollBehavior, Element& associatedElement);
39
40
} // namespace WebCore
- a/Source/WebCore/page/ScrollBehavior.idl +26 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.idl_sec1
1
/*
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
enum ScrollBehavior { "auto", "instant", "smooth" };
- a/Source/WebCore/page/ScrollIntoViewOptions.h -3 / +2 lines
Lines 20-31 a/Source/WebCore/page/ScrollIntoViewOptions.h_sec1
20
#pragma once
20
#pragma once
21
21
22
#include "ScrollLogicalPosition.h"
22
#include "ScrollLogicalPosition.h"
23
#include "ScrollOptions.h"
23
24
24
namespace WebCore {
25
namespace WebCore {
25
26
26
class Element;
27
struct ScrollIntoViewOptions : ScrollOptions {
27
28
struct ScrollIntoViewOptions {
29
    Optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start };
28
    Optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start };
30
    Optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest };
29
    Optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest };
31
};
30
};
- a/Source/WebCore/page/ScrollIntoViewOptions.idl -16 / +21 lines
Lines 1-24 a/Source/WebCore/page/ScrollIntoViewOptions.idl_sec1
1
/*
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
3
 *
4
 * This library is free software; you can redistribute it and/or
4
 * Redistribution and use in source and binary forms, with or without
5
 * modify it under the terms of the GNU Library General Public
5
 * modification, are permitted provided that the following conditions
6
 * License as published by the Free Software Foundation; either
6
 * are met:
7
 * version 2 of the License, or (at your option) any later version.
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
8
 *
12
 *
9
 * This library is distributed in the hope that it will be useful,
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12
 * Library General Public License for more details.
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
13
 *
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
14
 * You should have received a copy of the GNU Library General Public License
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15
 * along with this library; see the file COPYING.LIB.  If not, write to
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
17
 * Boston, MA 02110-1301, USA.
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18
 */
24
 */
19
25
20
// FIXME(webkit.org/b/188043): Support ScrollBehavior.
26
dictionary ScrollIntoViewOptions : ScrollOptions {
21
dictionary ScrollIntoViewOptions {
22
    [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
27
    [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
23
    [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
28
    [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
24
};
29
};
- a/Source/WebCore/page/ScrollOptions.h +36 lines
Line 0 a/Source/WebCore/page/ScrollOptions.h_sec1
1
/*
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include "ScrollBehavior.h"
29
30
namespace WebCore {
31
32
struct ScrollOptions {
33
    Optional<ScrollBehavior> behavior { ScrollBehavior::Auto };
34
};
35
36
} // namespace WebCore
- a/Source/WebCore/page/ScrollOptions.idl +28 lines
Line 0 a/Source/WebCore/page/ScrollOptions.idl_sec1
1
/*
2
 * Copyright (C) 2019 Igalia S.L. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
dictionary ScrollOptions {
27
    ScrollBehavior behavior = "auto";
28
};
- a/Source/WebCore/page/ScrollToOptions.h -2 / +9 lines
Lines 28-41 a/Source/WebCore/page/ScrollToOptions.h_sec1
28
28
29
#pragma once
29
#pragma once
30
30
31
#include "ScrollOptions.h"
31
#include <cmath>
32
#include <cmath>
32
#include <wtf/Optional.h>
33
#include <wtf/Optional.h>
33
34
34
namespace WebCore {
35
namespace WebCore {
35
36
36
struct ScrollToOptions {
37
struct ScrollToOptions : ScrollOptions {
37
    Optional<double> left;
38
    Optional<double> left;
38
    Optional<double> top;
39
    Optional<double> top;
40
41
    ScrollToOptions() = default;
42
    ScrollToOptions(double x, double y)
43
        : left(x)
44
        , top(y)
45
    { }
39
};
46
};
40
47
41
inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue)
48
inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue)
Lines 47-53 inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double a/Source/WebCore/page/ScrollToOptions.h_sec2
47
// FIXME(https://webkit.org/b/88339): Consider using FloatPoint or DoublePoint for fallback and return values.
54
// FIXME(https://webkit.org/b/88339): Consider using FloatPoint or DoublePoint for fallback and return values.
48
inline ScrollToOptions normalizeNonFiniteCoordinatesOrFallBackTo(const ScrollToOptions& value, double x, double y)
55
inline ScrollToOptions normalizeNonFiniteCoordinatesOrFallBackTo(const ScrollToOptions& value, double x, double y)
49
{
56
{
50
    ScrollToOptions options;
57
    ScrollToOptions options = value;
51
    options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
58
    options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
52
    options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
59
    options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
53
    return options;
60
    return options;
- a/Source/WebCore/page/ScrollToOptions.idl -2 / +1 lines
Lines 26-33 a/Source/WebCore/page/ScrollToOptions.idl_sec1
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
28
29
// FIXME(webkit.org/b/188043): Support ScrollBehavior.
29
dictionary ScrollToOptions : ScrollOptions {
30
dictionary ScrollToOptions {
31
    unrestricted double left;
30
    unrestricted double left;
32
    unrestricted double top;
31
    unrestricted double top;
33
};
32
};
- a/Source/WebCore/page/Settings.yaml +3 lines
Lines 615-620 syntheticEditingCommandsEnabled: a/Source/WebCore/page/Settings.yaml_sec1
615
CSSOMViewScrollingAPIEnabled:
615
CSSOMViewScrollingAPIEnabled:
616
  initial: false
616
  initial: false
617
617
618
CSSOMViewSmoothScrollingEnabled:
619
  initial: false
620
618
inputEventsEnabled:
621
inputEventsEnabled:
619
  initial: true
622
  initial: true
620
623
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp -2 / +44 lines
Lines 248-254 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scro a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec1
248
248
249
    bool inBackForwardCache = frameView->frame().document()->backForwardCacheState() != Document::NotInBackForwardCache;
249
    bool inBackForwardCache = frameView->frame().document()->backForwardCacheState() != Document::NotInBackForwardCache;
250
    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
250
    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
251
    if (inProgrammaticScroll || inBackForwardCache)
251
    bool animated = false;
252
253
#if PLATFORM(IOS_FAMILY)
254
    animated = scrollableArea.currentScrollBehaviorType() == ScrollBehaviorType::Smooth;
255
#endif
256
257
    // The scroll position of animated scrolling will be set from the UI side. So it shouldn't be set now. 
258
    if (!animated && (inProgrammaticScroll || inBackForwardCache))
252
        updateScrollPositionAfterAsyncScroll(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
259
        updateScrollPositionAfterAsyncScroll(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
253
260
254
    // If this frame view's document is being put into the back/forward cache, we don't want to update our
261
    // If this frame view's document is being put into the back/forward cache, we don't want to update our
Lines 260-266 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scro a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec2
260
    if (!stateNode)
267
    if (!stateNode)
261
        return false;
268
        return false;
262
269
263
    stateNode->setRequestedScrollPosition(scrollPosition, inProgrammaticScroll);
270
#if PLATFORM(IOS_FAMILY)
271
    if (animated)
272
        scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::InUINativeAnimation);
273
    else
274
        scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
275
#else
276
    // If web scroll animation is in progress, this is set by scroll animator, otherwise the animation should stop first.
277
    if (!scrollableArea.isWebScrollAnimationInProgress())
278
        scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
279
#endif
280
281
    stateNode->setRequestedScrollPosition(scrollPosition, inProgrammaticScroll, animated);
264
    return true;
282
    return true;
265
}
283
}
266
284
Lines 291-296 void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(Scr a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec3
291
    m_updateNodeScrollPositionTimer.startOneShot(0_s);
309
    m_updateNodeScrollPositionTimer.startOneShot(0_s);
292
}
310
}
293
311
312
void AsyncScrollingCoordinator::setScrollAnimationInProgress(ScrollingNodeID nodeID, bool isScrollAnimationInProgress)
313
{
314
    ASSERT(isMainThread());
315
316
    if (!m_page)
317
        return;
318
319
    auto* frameView = frameViewForScrollingNode(nodeID);
320
    if (!frameView)
321
        return;
322
323
    if (nodeID == frameView->scrollingNodeID()) {
324
        if (!isScrollAnimationInProgress)
325
            frameView->setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
326
        return;
327
    }
328
329
    // Overflow-scroll area.
330
    if (auto* scrollableArea = frameView->scrollableAreaForScrollLayerID(nodeID)) {
331
        if (!isScrollAnimationInProgress)
332
            scrollableArea->setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
333
    }
334
}
335
294
void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired()
336
void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired()
295
{
337
{
296
    updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.layoutViewportOrigin, ScrollType::User, m_scheduledScrollUpdate.updateLayerPositionAction);
338
    updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.layoutViewportOrigin, ScrollType::User, m_scheduledScrollUpdate.updateLayerPositionAction);
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h +2 lines
Lines 53-58 public: a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h_sec1
53
53
54
    WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction);
54
    WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction);
55
55
56
    WEBCORE_EXPORT void setScrollAnimationInProgress(ScrollingNodeID, bool isScrollAnimationInProgress);
57
56
#if PLATFORM(COCOA)
58
#if PLATFORM(COCOA)
57
    WEBCORE_EXPORT void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex);
59
    WEBCORE_EXPORT void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex);
58
    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const;
60
    void deferWheelEventTestCompletionForReason(WheelEventTestMonitor::ScrollableAreaIdentifier, WheelEventTestMonitor::DeferReason) const;
- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp -1 / +6 lines
Lines 56-61 ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScr a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp_sec1
56
#endif
56
#endif
57
    , m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
57
    , m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
58
    , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
58
    , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
59
    , m_requestedScrollPositionWithAnimation(stateNode.requestedScrollPositionWithAnimation())
59
    , m_isMonitoringWheelEvents(stateNode.isMonitoringWheelEvents())
60
    , m_isMonitoringWheelEvents(stateNode.isMonitoringWheelEvents())
60
{
61
{
61
    if (hasChangedProperty(ScrollContainerLayer))
62
    if (hasChangedProperty(ScrollContainerLayer))
Lines 219-228 void ScrollingStateScrollingNode::setScrollableAreaParameters(const ScrollableAr a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp_sec2
219
    setPropertyChanged(ScrollableAreaParams);
220
    setPropertyChanged(ScrollableAreaParams);
220
}
221
}
221
222
222
void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& requestedScrollPosition, bool representsProgrammaticScroll)
223
void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& requestedScrollPosition, bool representsProgrammaticScroll, bool requestedWithAnimation)
223
{
224
{
224
    m_requestedScrollPosition = requestedScrollPosition;
225
    m_requestedScrollPosition = requestedScrollPosition;
225
    m_requestedScrollPositionRepresentsProgrammaticScroll = representsProgrammaticScroll;
226
    m_requestedScrollPositionRepresentsProgrammaticScroll = representsProgrammaticScroll;
227
    m_requestedScrollPositionWithAnimation = requestedWithAnimation;
226
    setPropertyChanged(RequestedScrollPosition);
228
    setPropertyChanged(RequestedScrollPosition);
227
}
229
}
228
230
Lines 314-319 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, ScrollingStateT a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp_sec3
314
    if (m_requestedScrollPositionRepresentsProgrammaticScroll)
316
    if (m_requestedScrollPositionRepresentsProgrammaticScroll)
315
        ts.dumpProperty("requested scroll position represents programmatic scroll", m_requestedScrollPositionRepresentsProgrammaticScroll);
317
        ts.dumpProperty("requested scroll position represents programmatic scroll", m_requestedScrollPositionRepresentsProgrammaticScroll);
316
318
319
    if (m_requestedScrollPositionWithAnimation)
320
        ts.dumpProperty("requested scroll position with animation", m_requestedScrollPositionWithAnimation);
321
317
    if (!m_parentRelativeScrollableRect.isEmpty())
322
    if (!m_parentRelativeScrollableRect.isEmpty())
318
        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
323
        ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
319
324
- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h -1 / +3 lines
Lines 111-117 public: a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h_sec1
111
111
112
    const FloatPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
112
    const FloatPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
113
    bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
113
    bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
114
    WEBCORE_EXPORT void setRequestedScrollPosition(const FloatPoint&, bool representsProgrammaticScroll);
114
    bool requestedScrollPositionWithAnimation() const { return m_requestedScrollPositionWithAnimation; }
115
    WEBCORE_EXPORT void setRequestedScrollPosition(const FloatPoint&, bool representsProgrammaticScroll, bool requestedWithAnimation = false);
115
116
116
    bool isMonitoringWheelEvents() const { return m_isMonitoringWheelEvents; }
117
    bool isMonitoringWheelEvents() const { return m_isMonitoringWheelEvents; }
117
    WEBCORE_EXPORT void setIsMonitoringWheelEvents(bool);
118
    WEBCORE_EXPORT void setIsMonitoringWheelEvents(bool);
Lines 171-176 private: a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h_sec2
171
    ScrollableAreaParameters m_scrollableAreaParameters;
172
    ScrollableAreaParameters m_scrollableAreaParameters;
172
173
173
    bool m_requestedScrollPositionRepresentsProgrammaticScroll { false };
174
    bool m_requestedScrollPositionRepresentsProgrammaticScroll { false };
175
    bool m_requestedScrollPositionWithAnimation { false };
174
    bool m_isMonitoringWheelEvents { false };
176
    bool m_isMonitoringWheelEvents { false };
175
};
177
};
176
178
- a/Source/WebCore/page/scrolling/ScrollingTree.h -1 / +4 lines
Lines 83-89 public: a/Source/WebCore/page/scrolling/ScrollingTree.h_sec1
83
    virtual void scrollingTreeNodeDidScroll(ScrollingTreeScrollingNode&, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0;
83
    virtual void scrollingTreeNodeDidScroll(ScrollingTreeScrollingNode&, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0;
84
84
85
    // Called for requested scroll position updates.
85
    // Called for requested scroll position updates.
86
    virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint& /*scrollPosition*/, bool /*representsProgrammaticScroll*/) { }
86
    virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint& /*scrollPosition*/, bool /*representsProgrammaticScroll*/, bool /*withAnimation*/) { }
87
88
    // Called for scroll animation status updates.
89
    virtual void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool /*isScrollAnimationInProgress*/) { }
87
90
88
    // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers
91
    // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers
89
    WEBCORE_EXPORT void mainFrameViewportChangedViaDelegatedScrolling(const FloatPoint& scrollPosition, const WebCore::FloatRect& layoutViewport, double scale);
92
    WEBCORE_EXPORT void mainFrameViewportChangedViaDelegatedScrolling(const FloatPoint& scrollPosition, const WebCore::FloatRect& layoutViewport, double scale);
- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp -5 / +47 lines
Lines 108-114 void ScrollingTreeScrollingNode::commitStateAfterChildren(const ScrollingStateNo a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec1
108
{
108
{
109
    const ScrollingStateScrollingNode& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
109
    const ScrollingStateScrollingNode& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
110
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
110
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
111
        scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll());
111
        scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll(), scrollingStateNode.requestedScrollPositionWithAnimation());
112
112
113
    m_isFirstCommit = false;
113
    m_isFirstCommit = false;
114
}
114
}
Lines 157-167 void ScrollingTreeScrollingNode::scrollBy(const FloatSize& delta, ScrollPosition a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec2
157
    scrollTo(currentScrollPosition() + delta, ScrollType::User, clamp);
157
    scrollTo(currentScrollPosition() + delta, ScrollType::User, clamp);
158
}
158
}
159
159
160
void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType scrollType, ScrollPositionClamp clamp)
160
void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType scrollType, ScrollPositionClamp clamp, bool needSyncScrollPosition)
161
{
161
{
162
    if (position == m_currentScrollPosition)
162
    if (position == m_currentScrollPosition) {
163
        // Sync the scroll position to web side.
164
        if (requestScrollWithAnimation() && needSyncScrollPosition)
165
            scrollingTree().scrollingTreeNodeDidScroll(*this, ScrollingLayerPositionAction::Sync);
166
        scrollingTree().scrollingTreeNodeIsScrollAnimationInProgressDidChange(scrollingNodeID(), false);
167
        setRequestScrollWithAnimation(false);
163
        return;
168
        return;
169
    }
164
170
171
    // If during an scroll animation, need to stop it before starting a new one. 
172
    if (scrollAnimationInProgress())
173
        setNeedsStopCurrentScrollAnimation(true);
165
    scrollingTree().setIsHandlingProgrammaticScroll(scrollType == ScrollType::Programmatic);
174
    scrollingTree().setIsHandlingProgrammaticScroll(scrollType == ScrollType::Programmatic);
166
    
175
    
167
    m_currentScrollPosition = adjustedScrollPosition(position, clamp);
176
    m_currentScrollPosition = adjustedScrollPosition(position, clamp);
Lines 171-176 void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec3
171
    updateViewportForCurrentScrollPosition();
180
    updateViewportForCurrentScrollPosition();
172
    currentScrollPositionChanged();
181
    currentScrollPositionChanged();
173
182
183
    setNeedsStopCurrentScrollAnimation(false);
184
    setRequestScrollWithAnimation(false);
174
    scrollingTree().setIsHandlingProgrammaticScroll(false);
185
    scrollingTree().setIsHandlingProgrammaticScroll(false);
175
}
186
}
176
187
Lines 179-186 void ScrollingTreeScrollingNode::currentScrollPositionChanged() a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec4
179
    repositionScrollingLayers();
190
    repositionScrollingLayers();
180
    repositionRelatedLayers();
191
    repositionRelatedLayers();
181
192
182
    scrollingTree().notifyRelatedNodesAfterScrollPositionChange(*this);
193
    if (!requestScrollWithAnimation()) {
183
    scrollingTree().scrollingTreeNodeDidScroll(*this);
194
        scrollingTree().notifyRelatedNodesAfterScrollPositionChange(*this);
195
        scrollingTree().scrollingTreeNodeDidScroll(*this);
196
    }
184
}
197
}
185
198
186
bool ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch(const FloatPoint& position, Optional<FloatRect>)
199
bool ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch(const FloatPoint& position, Optional<FloatRect>)
Lines 266-271 void ScrollingTreeScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTr a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec5
266
    ts.dumpProperty("scrollable area parameters", m_scrollableAreaParameters);
279
    ts.dumpProperty("scrollable area parameters", m_scrollableAreaParameters);
267
}
280
}
268
281
282
void ScrollingTreeScrollingNode::setRequestScrollWithAnimation(bool withAnimation)
283
{
284
    m_requestScrollWithAnimation = withAnimation;
285
}
286
287
bool ScrollingTreeScrollingNode::requestScrollWithAnimation() const
288
{
289
    return m_requestScrollWithAnimation;
290
}
291
292
void ScrollingTreeScrollingNode::setScrollAnimationInProgress(bool inProgress)
293
{
294
    m_scrollAnimationInProgress = inProgress;
295
}
296
297
bool ScrollingTreeScrollingNode::scrollAnimationInProgress() const
298
{
299
    return m_scrollAnimationInProgress;
300
}
301
302
void ScrollingTreeScrollingNode::setNeedsStopCurrentScrollAnimation(bool stop)
303
{
304
    m_needsStopCurrentScrollAnimation = stop;
305
}
306
307
bool ScrollingTreeScrollingNode::needsStopCurrentScrollAnimation() const
308
{
309
    return m_needsStopCurrentScrollAnimation;
310
}
269
} // namespace WebCore
311
} // namespace WebCore
270
312
271
#endif // ENABLE(ASYNC_SCROLLING)
313
#endif // ENABLE(ASYNC_SCROLLING)
- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h -1 / +11 lines
Lines 60-66 public: a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h_sec1
60
    FloatSize scrollDeltaSinceLastCommit() const { return m_currentScrollPosition - m_lastCommittedScrollPosition; }
60
    FloatSize scrollDeltaSinceLastCommit() const { return m_currentScrollPosition - m_lastCommittedScrollPosition; }
61
61
62
    // These are imperative; they adjust the scrolling layers.
62
    // These are imperative; they adjust the scrolling layers.
63
    void scrollTo(const FloatPoint&, ScrollType = ScrollType::User, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
63
    void scrollTo(const FloatPoint&, ScrollType = ScrollType::User, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges, bool needSnycScrollPosition = false);
64
    void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
64
    void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
65
65
66
    void wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport = { }, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
66
    void wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport = { }, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
Lines 91-96 public: a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h_sec2
91
    const LayerRepresentation& scrollContainerLayer() const { return m_scrollContainerLayer; }
91
    const LayerRepresentation& scrollContainerLayer() const { return m_scrollContainerLayer; }
92
    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
92
    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
93
93
94
    void setRequestScrollWithAnimation(bool);
95
    bool requestScrollWithAnimation() const;
96
    void setScrollAnimationInProgress(bool);
97
    bool scrollAnimationInProgress() const;
98
    void setNeedsStopCurrentScrollAnimation(bool);
99
    bool needsStopCurrentScrollAnimation() const;
100
94
protected:
101
protected:
95
    ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
102
    ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
96
103
Lines 147-152 private: a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h_sec3
147
#endif
154
#endif
148
    ScrollableAreaParameters m_scrollableAreaParameters;
155
    ScrollableAreaParameters m_scrollableAreaParameters;
149
    bool m_isFirstCommit { true };
156
    bool m_isFirstCommit { true };
157
    bool m_requestScrollWithAnimation { false };
158
    bool m_scrollAnimationInProgress { false };
159
    bool m_needsStopCurrentScrollAnimation { false };
150
160
151
    LayerRepresentation m_scrollContainerLayer;
161
    LayerRepresentation m_scrollContainerLayer;
152
    LayerRepresentation m_scrolledContentsLayer;
162
    LayerRepresentation m_scrolledContentsLayer;
- a/Source/WebCore/platform/ScrollAnimation.h +3 lines
Lines 32-47 namespace WebCore { a/Source/WebCore/platform/ScrollAnimation.h_sec1
32
32
33
class FloatPoint;
33
class FloatPoint;
34
class ScrollableArea;
34
class ScrollableArea;
35
enum class ScrollClamping : uint8_t;
35
36
36
class ScrollAnimation {
37
class ScrollAnimation {
37
    WTF_MAKE_FAST_ALLOCATED;
38
    WTF_MAKE_FAST_ALLOCATED;
38
public:
39
public:
39
    virtual ~ScrollAnimation() { };
40
    virtual ~ScrollAnimation() { };
40
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float /* step */, float /* multiplier */) { return true; };
41
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float /* step */, float /* multiplier */) { return true; };
42
    virtual void scroll(const FloatPoint&) { };
41
    virtual void stop() = 0;
43
    virtual void stop() = 0;
42
    virtual void updateVisibleLengths() { };
44
    virtual void updateVisibleLengths() { };
43
    virtual void setCurrentPosition(const FloatPoint&) { };
45
    virtual void setCurrentPosition(const FloatPoint&) { };
44
    virtual void serviceAnimation() { };
46
    virtual void serviceAnimation() { };
47
    virtual bool isScrollInProgress() const { return false; }
45
48
46
protected:
49
protected:
47
    ScrollAnimation(ScrollableArea& scrollableArea)
50
    ScrollAnimation(ScrollableArea& scrollableArea)
- a/Source/WebCore/platform/ScrollAnimationKinetic.cpp +5 lines
Lines 165-168 void ScrollAnimationKinetic::animationTimerFired() a/Source/WebCore/platform/ScrollAnimationKinetic.cpp_sec1
165
    m_notifyPositionChangedFunction(FloatPoint(m_position));
165
    m_notifyPositionChangedFunction(FloatPoint(m_position));
166
}
166
}
167
167
168
bool ScrollAnimationKinetic::isScrollInProgress() const
169
{
170
    return m_animationTimer.isActive();
171
}
172
168
} // namespace WebCore
173
} // namespace WebCore
- a/Source/WebCore/platform/ScrollAnimationKinetic.h +1 lines
Lines 66-71 public: a/Source/WebCore/platform/ScrollAnimationKinetic.h_sec1
66
private:
66
private:
67
    void stop() override;
67
    void stop() override;
68
    void animationTimerFired();
68
    void animationTimerFired();
69
    bool isScrollInProgress() const override;
69
70
70
    std::function<void(FloatPoint&&)> m_notifyPositionChangedFunction;
71
    std::function<void(FloatPoint&&)> m_notifyPositionChangedFunction;
71
72
- a/Source/WebCore/platform/ScrollAnimationSmooth.cpp -5 / +20 lines
Lines 28-35 a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec1
28
#include "config.h"
28
#include "config.h"
29
#include "ScrollAnimationSmooth.h"
29
#include "ScrollAnimationSmooth.h"
30
30
31
#if ENABLE(SMOOTH_SCROLLING)
32
33
#include "FloatPoint.h"
31
#include "FloatPoint.h"
34
#include "ScrollableArea.h"
32
#include "ScrollableArea.h"
35
33
Lines 38-43 namespace WebCore { a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec2
38
static const double frameRate = 60;
36
static const double frameRate = 60;
39
static const Seconds tickTime = 1_s / frameRate;
37
static const Seconds tickTime = 1_s / frameRate;
40
static const Seconds minimumTimerInterval { 1_ms };
38
static const Seconds minimumTimerInterval { 1_ms };
39
static const double smoothFactorForProgrammaticScroll = 5;
41
40
42
ScrollAnimationSmooth::ScrollAnimationSmooth(ScrollableArea& scrollableArea, const FloatPoint& position, WTF::Function<void (FloatPoint&&)>&& notifyPositionChangedFunction)
41
ScrollAnimationSmooth::ScrollAnimationSmooth(ScrollableArea& scrollableArea, const FloatPoint& position, WTF::Function<void (FloatPoint&&)>&& notifyPositionChangedFunction)
43
    : ScrollAnimation(scrollableArea)
42
    : ScrollAnimation(scrollableArea)
Lines 67-72 bool ScrollAnimationSmooth::scroll(ScrollbarOrientation orientation, ScrollGranu a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec3
67
    return needToScroll;
66
    return needToScroll;
68
}
67
}
69
68
69
void ScrollAnimationSmooth::scroll(const FloatPoint& position)
70
{
71
    ScrollGranularity granularity = ScrollByPage;
72
    bool needToScroll = updatePerAxisData(m_horizontalData, granularity, position.x() - m_horizontalData.currentPosition, m_scrollableArea.minimumScrollPosition().x(), m_scrollableArea.maximumScrollPosition().x(), smoothFactorForProgrammaticScroll);
73
    needToScroll |=
74
        updatePerAxisData(m_verticalData, granularity, position.y() - m_verticalData.currentPosition, m_scrollableArea.minimumScrollPosition().y(), m_scrollableArea.maximumScrollPosition().y(), smoothFactorForProgrammaticScroll);
75
    if (needToScroll && !animationTimerActive()) {
76
        m_startTime = m_horizontalData.startTime;
77
        animationTimerFired();
78
    }
79
};
80
70
void ScrollAnimationSmooth::stop()
81
void ScrollAnimationSmooth::stop()
71
{
82
{
72
    m_animationTimer.stop();
83
    m_animationTimer.stop();
Lines 247-253 static inline void getAnimationParametersForGranularity(ScrollGranularity granul a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec4
247
    }
258
    }
248
}
259
}
249
260
250
bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranularity granularity, float delta, float minScrollPosition, float maxScrollPosition)
261
bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranularity granularity, float delta, float minScrollPosition, float maxScrollPosition, double smoothFactor)
251
{
262
{
252
    if (!data.startTime || !delta || (delta < 0) != (data.desiredPosition - data.currentPosition < 0)) {
263
    if (!data.startTime || !delta || (delta < 0) != (data.desiredPosition - data.currentPosition < 0)) {
253
        data.desiredPosition = data.currentPosition;
264
        data.desiredPosition = data.currentPosition;
Lines 264-269 bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec5
264
    Curve coastTimeCurve;
275
    Curve coastTimeCurve;
265
    getAnimationParametersForGranularity(granularity, animationTime, repeatMinimumSustainTime, attackTime, releaseTime, coastTimeCurve, maximumCoastTime);
276
    getAnimationParametersForGranularity(granularity, animationTime, repeatMinimumSustainTime, attackTime, releaseTime, coastTimeCurve, maximumCoastTime);
266
277
278
    animationTime *= smoothFactor;
279
    repeatMinimumSustainTime *= smoothFactor;
280
    attackTime *= smoothFactor;
281
    releaseTime *= smoothFactor;
282
    maximumCoastTime *= smoothFactor;
283
267
    data.desiredPosition = newPosition;
284
    data.desiredPosition = newPosition;
268
    if (!data.startTime)
285
    if (!data.startTime)
269
        data.attackTime = attackTime;
286
        data.attackTime = attackTime;
Lines 407-411 bool ScrollAnimationSmooth::animationTimerActive() const a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec6
407
}
424
}
408
425
409
} // namespace WebCore
426
} // namespace WebCore
410
411
#endif // ENABLE(SMOOTH_SCROLLING)
- a/Source/WebCore/platform/ScrollAnimationSmooth.h -4 / +4 lines
Lines 27-40 a/Source/WebCore/platform/ScrollAnimationSmooth.h_sec1
27
27
28
#include "ScrollAnimation.h"
28
#include "ScrollAnimation.h"
29
29
30
#if ENABLE(SMOOTH_SCROLLING)
31
32
#include "Timer.h"
30
#include "Timer.h"
33
31
34
namespace WebCore {
32
namespace WebCore {
35
33
36
class FloatPoint;
34
class FloatPoint;
37
class ScrollableArea;
35
class ScrollableArea;
36
enum class ScrollClamping : uint8_t;
38
37
39
class ScrollAnimationSmooth final: public ScrollAnimation {
38
class ScrollAnimationSmooth final: public ScrollAnimation {
40
public:
39
public:
Lines 51-59 public: a/Source/WebCore/platform/ScrollAnimationSmooth.h_sec2
51
50
52
private:
51
private:
53
    bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier) override;
52
    bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier) override;
53
    void scroll(const FloatPoint&) override;
54
    void stop() override;
54
    void stop() override;
55
    void updateVisibleLengths() override;
55
    void updateVisibleLengths() override;
56
    void setCurrentPosition(const FloatPoint&) override;
56
    void setCurrentPosition(const FloatPoint&) override;
57
    bool isScrollInProgress() const override { return animationTimerActive(); }
57
58
58
    struct PerAxisData {
59
    struct PerAxisData {
59
        PerAxisData() = delete;
60
        PerAxisData() = delete;
Lines 89-95 private: a/Source/WebCore/platform/ScrollAnimationSmooth.h_sec3
89
        int visibleLength { 0 };
90
        int visibleLength { 0 };
90
    };
91
    };
91
92
92
    bool updatePerAxisData(PerAxisData&, ScrollGranularity, float delta, float minScrollPosition, float maxScrollPosition);
93
    bool updatePerAxisData(PerAxisData&, ScrollGranularity, float delta, float minScrollPosition, float maxScrollPosition, double smoothFactor = 1);
93
    bool animateScroll(PerAxisData&, MonotonicTime currentTime);
94
    bool animateScroll(PerAxisData&, MonotonicTime currentTime);
94
95
95
    void requestAnimationTimerFired();
96
    void requestAnimationTimerFired();
Lines 108-111 private: a/Source/WebCore/platform/ScrollAnimationSmooth.h_sec4
108
109
109
} // namespace WebCore
110
} // namespace WebCore
110
111
111
#endif // ENABLE(SMOOTH_SCROLLING)
- a/Source/WebCore/platform/ScrollAnimator.cpp +57 lines
Lines 35-40 a/Source/WebCore/platform/ScrollAnimator.cpp_sec1
35
#include "FloatPoint.h"
35
#include "FloatPoint.h"
36
#include "LayoutSize.h"
36
#include "LayoutSize.h"
37
#include "PlatformWheelEvent.h"
37
#include "PlatformWheelEvent.h"
38
#include "ScrollAnimationSmooth.h"
38
#include "ScrollableArea.h"
39
#include "ScrollableArea.h"
39
#include <algorithm>
40
#include <algorithm>
40
41
Lines 52-62 ScrollAnimator::ScrollAnimator(ScrollableArea& scrollableArea) a/Source/WebCore/platform/ScrollAnimator.cpp_sec2
52
#if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
53
#if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
53
    , m_scrollController(*this)
54
    , m_scrollController(*this)
54
#endif
55
#endif
56
    , m_animationProgrammaticScroll(makeUnique<ScrollAnimationSmooth>(scrollableArea, m_currentPosition, [this](FloatPoint&& position) {
57
        auto previousScrollType = m_scrollableArea.currentScrollType();
58
        m_scrollableArea.setCurrentScrollType(ScrollType::Programmatic);
59
        bool updated = m_scrollableArea.requestScrollPositionUpdate(roundedIntPoint(position));
60
        m_scrollableArea.setCurrentScrollType(previousScrollType);
61
        if (updated)
62
            return;
63
64
        FloatSize delta = position - m_currentPosition;
65
        m_currentPosition = WTFMove(position);
66
        notifyPositionChanged(delta);
67
    }))
55
{
68
{
56
}
69
}
57
70
58
ScrollAnimator::~ScrollAnimator() = default;
71
ScrollAnimator::~ScrollAnimator() = default;
59
72
73
bool ScrollAnimator::isScrollInProgress() const
74
{
75
    // FIXME (TODO): This should also take into account animations in derived classes.
76
    return m_animationProgrammaticScroll->isScrollInProgress();
77
}
78
60
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
79
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
61
{
80
{
62
    FloatPoint currentPosition = this->currentPosition();
81
    FloatPoint currentPosition = this->currentPosition();
Lines 75-80 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, a/Source/WebCore/platform/ScrollAnimator.cpp_sec3
75
    return true;
94
    return true;
76
}
95
}
77
96
97
void ScrollAnimator::scrollToOffset(const FloatPoint& offset)
98
{
99
    m_animationProgrammaticScroll->setCurrentPosition(m_currentPosition);
100
    auto newPosition = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
101
    m_animationProgrammaticScroll->scroll(newPosition);
102
    m_scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::WebAnimationTimerStarted);
103
}
104
78
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
105
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
79
{
106
{
80
    FloatPoint newPositon = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
107
    FloatPoint newPositon = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
Lines 245-248 void ScrollAnimator::removeWheelEventTestCompletionDeferralForReason(WheelEventT a/Source/WebCore/platform/ScrollAnimator.cpp_sec4
245
}
272
}
246
#endif
273
#endif
247
274
275
void ScrollAnimator::cancelAnimations()
276
{
277
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
278
    m_animationProgrammaticScroll->stop();
279
#endif
280
    m_scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
281
}
282
283
void ScrollAnimator::serviceScrollAnimations()
284
{
285
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
286
    m_animationProgrammaticScroll->serviceAnimation();
287
#endif
288
}
289
290
void ScrollAnimator::willEndLiveResize()
291
{
292
    m_animationProgrammaticScroll->updateVisibleLengths();
293
}
294
295
void ScrollAnimator::didAddVerticalScrollbar(Scrollbar*)
296
{
297
    m_animationProgrammaticScroll->updateVisibleLengths();
298
}
299
300
void ScrollAnimator::didAddHorizontalScrollbar(Scrollbar*)
301
{
302
    m_animationProgrammaticScroll->updateVisibleLengths();
303
}
304
248
} // namespace WebCore
305
} // namespace WebCore
- a/Source/WebCore/platform/ScrollAnimator.h -5 / +10 lines
Lines 46-51 namespace WebCore { a/Source/WebCore/platform/ScrollAnimator.h_sec1
46
46
47
class FloatPoint;
47
class FloatPoint;
48
class PlatformTouchEvent;
48
class PlatformTouchEvent;
49
class ScrollAnimation;
49
class ScrollableArea;
50
class ScrollableArea;
50
class Scrollbar;
51
class Scrollbar;
51
class WheelEventTestMonitor;
52
class WheelEventTestMonitor;
Lines 68-73 public: a/Source/WebCore/platform/ScrollAnimator.h_sec2
68
    // The base class implementation always scrolls immediately, never animates.
69
    // The base class implementation always scrolls immediately, never animates.
69
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
70
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
70
71
72
    void scrollToOffset(const FloatPoint&);
71
    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
73
    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
72
74
73
    ScrollableArea& scrollableArea() const { return m_scrollableArea; }
75
    ScrollableArea& scrollableArea() const { return m_scrollableArea; }
Lines 85-92 public: a/Source/WebCore/platform/ScrollAnimator.h_sec3
85
    void setCurrentPosition(const FloatPoint&);
87
    void setCurrentPosition(const FloatPoint&);
86
    const FloatPoint& currentPosition() const { return m_currentPosition; }
88
    const FloatPoint& currentPosition() const { return m_currentPosition; }
87
89
88
    virtual void cancelAnimations() { }
90
    virtual void cancelAnimations();
89
    virtual void serviceScrollAnimations() { }
91
    virtual void serviceScrollAnimations();
90
92
91
    virtual void contentAreaWillPaint() const { }
93
    virtual void contentAreaWillPaint() const { }
92
    virtual void mouseEnteredContentArea() { }
94
    virtual void mouseEnteredContentArea() { }
Lines 97-112 public: a/Source/WebCore/platform/ScrollAnimator.h_sec4
97
    virtual void mouseIsDownInScrollbar(Scrollbar*, bool) const { }
99
    virtual void mouseIsDownInScrollbar(Scrollbar*, bool) const { }
98
    virtual void willStartLiveResize() { }
100
    virtual void willStartLiveResize() { }
99
    virtual void contentsResized() const { }
101
    virtual void contentsResized() const { }
100
    virtual void willEndLiveResize() { }
102
    virtual void willEndLiveResize();
101
    virtual void contentAreaDidShow() { }
103
    virtual void contentAreaDidShow() { }
102
    virtual void contentAreaDidHide() { }
104
    virtual void contentAreaDidHide() { }
103
105
104
    virtual void lockOverlayScrollbarStateToHidden(bool) { }
106
    virtual void lockOverlayScrollbarStateToHidden(bool) { }
105
    virtual bool scrollbarsCanBeActive() const { return true; }
107
    virtual bool scrollbarsCanBeActive() const { return true; }
106
108
107
    virtual void didAddVerticalScrollbar(Scrollbar*) { }
109
    virtual void didAddVerticalScrollbar(Scrollbar*);
108
    virtual void willRemoveVerticalScrollbar(Scrollbar*) { }
110
    virtual void willRemoveVerticalScrollbar(Scrollbar*) { }
109
    virtual void didAddHorizontalScrollbar(Scrollbar*) { }
111
    virtual void didAddHorizontalScrollbar(Scrollbar*);
110
    virtual void willRemoveHorizontalScrollbar(Scrollbar*) { }
112
    virtual void willRemoveHorizontalScrollbar(Scrollbar*) { }
111
113
112
    virtual void invalidateScrollbarPartLayers(Scrollbar*) { }
114
    virtual void invalidateScrollbarPartLayers(Scrollbar*) { }
Lines 120-125 public: a/Source/WebCore/platform/ScrollAnimator.h_sec5
120
122
121
    virtual bool isRubberBandInProgress() const { return false; }
123
    virtual bool isRubberBandInProgress() const { return false; }
122
    virtual bool isScrollSnapInProgress() const { return false; }
124
    virtual bool isScrollSnapInProgress() const { return false; }
125
    bool isScrollInProgress() const;
123
126
124
    void setWheelEventTestMonitor(RefPtr<WheelEventTestMonitor>&& testMonitor) { m_wheelEventTestMonitor = testMonitor; }
127
    void setWheelEventTestMonitor(RefPtr<WheelEventTestMonitor>&& testMonitor) { m_wheelEventTestMonitor = testMonitor; }
125
128
Lines 151-156 protected: a/Source/WebCore/platform/ScrollAnimator.h_sec6
151
    ScrollController m_scrollController;
154
    ScrollController m_scrollController;
152
#endif
155
#endif
153
    FloatPoint m_currentPosition;
156
    FloatPoint m_currentPosition;
157
158
    std::unique_ptr<ScrollAnimation> m_animationProgrammaticScroll;
154
};
159
};
155
160
156
} // namespace WebCore
161
} // namespace WebCore
- a/Source/WebCore/platform/ScrollTypes.h +13 lines
Lines 54-59 enum class ScrollPositionClamp : uint8_t { a/Source/WebCore/platform/ScrollTypes.h_sec1
54
    ToContentEdges,
54
    ToContentEdges,
55
};
55
};
56
56
57
enum class ScrollBehaviorType : uint8_t {
58
    Instant,
59
    Smooth,
60
};
61
62
enum class ScrollBehaviorStatus : uint8_t {
63
    NotInAnimation,
64
    WebAnimationTimerStarted,
65
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
66
    InUINativeAnimation,
67
#endif
68
};
69
57
inline ScrollDirection logicalToPhysical(ScrollLogicalDirection direction, bool isVertical, bool isFlipped)
70
inline ScrollDirection logicalToPhysical(ScrollLogicalDirection direction, bool isVertical, bool isFlipped)
58
{
71
{
59
    switch (direction) {
72
    switch (direction) {
- a/Source/WebCore/platform/ScrollView.cpp -3 / +9 lines
Lines 461-470 void ScrollView::completeUpdatesAfterScrollTo(const IntSize& scrollDelta) a/Source/WebCore/platform/ScrollView.cpp_sec1
461
    updateCompositingLayersAfterScrolling();
461
    updateCompositingLayersAfterScrolling();
462
}
462
}
463
463
464
void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition)
464
void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition, bool/* animated*/)
465
{
465
{
466
    LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition);
466
    LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition);
467
467
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
468
    setCurrentScrollBehaviorType(ScrollBehaviorType::Instant);
469
#endif
468
    if (prohibitsScrolling())
470
    if (prohibitsScrolling())
469
        return;
471
        return;
470
472
Lines 475-487 void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition) a/Source/WebCore/platform/ScrollView.cpp_sec2
475
477
476
    ScrollPosition newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
478
    ScrollPosition newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
477
479
478
    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && newScrollPosition == this->scrollPosition())
480
    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && !isScrollInProgress() && newScrollPosition == this->scrollPosition())
479
        return;
481
        return;
480
482
483
    if (isWebScrollAnimationInProgress())
484
        scrollAnimator().cancelAnimations();
485
481
    if (requestScrollPositionUpdate(newScrollPosition))
486
    if (requestScrollPositionUpdate(newScrollPosition))
482
        return;
487
        return;
483
488
484
    updateScrollbars(newScrollPosition);
489
    updateScrollbars(newScrollPosition);
490
    setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
485
}
491
}
486
492
487
bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
493
bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
- a/Source/WebCore/platform/ScrollView.h -1 / +1 lines
Lines 260-266 public: a/Source/WebCore/platform/ScrollView.h_sec1
260
    ScrollPosition cachedScrollPosition() const { return m_cachedScrollPosition; }
260
    ScrollPosition cachedScrollPosition() const { return m_cachedScrollPosition; }
261
261
262
    // Functions for scrolling the view.
262
    // Functions for scrolling the view.
263
    virtual void setScrollPosition(const ScrollPosition&);
263
    virtual void setScrollPosition(const ScrollPosition&, bool animated = false);
264
    void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); }
264
    void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); }
265
265
266
    // This function scrolls by lines, pages or pixels.
266
    // This function scrolls by lines, pages or pixels.
- a/Source/WebCore/platform/ScrollableArea.cpp -3 / +30 lines
Lines 71-76 ScrollableArea::ScrollableArea() a/Source/WebCore/platform/ScrollableArea.cpp_sec1
71
    , m_scrollOriginChanged(false)
71
    , m_scrollOriginChanged(false)
72
    , m_currentScrollType(static_cast<unsigned>(ScrollType::User))
72
    , m_currentScrollType(static_cast<unsigned>(ScrollType::User))
73
    , m_scrollShouldClearLatchedState(false)
73
    , m_scrollShouldClearLatchedState(false)
74
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
75
    , m_currentScrollBehaviorType(static_cast<unsigned>(ScrollBehaviorType::Instant))
76
#endif
74
{
77
{
75
}
78
}
76
79
Lines 104-109 float ScrollableArea::adjustScrollStepForFixedContent(float step, ScrollbarOrien a/Source/WebCore/platform/ScrollableArea.cpp_sec2
104
    return step;
107
    return step;
105
}
108
}
106
109
110
bool ScrollableArea::isScrollInProgress()
111
{
112
    if (m_currentScrollBehaviorStatus == ScrollBehaviorStatus::WebAnimationTimerStarted) {
113
        if (!(m_scrollAnimator && scrollAnimator().isScrollInProgress()))
114
            m_currentScrollBehaviorStatus = ScrollBehaviorStatus::NotInAnimation;
115
    }
116
    return m_currentScrollBehaviorStatus != ScrollBehaviorStatus::NotInAnimation;
117
}
118
119
bool ScrollableArea::isWebScrollAnimationInProgress()
120
{
121
    if (m_currentScrollBehaviorStatus == ScrollBehaviorStatus::WebAnimationTimerStarted) {
122
        if (!(m_scrollAnimator && scrollAnimator().isScrollInProgress()))
123
            m_currentScrollBehaviorStatus = ScrollBehaviorStatus::NotInAnimation;
124
    }
125
    return m_currentScrollBehaviorStatus == ScrollBehaviorStatus::WebAnimationTimerStarted;
126
}
127
107
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
128
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
108
{
129
{
109
    ScrollbarOrientation orientation;
130
    ScrollbarOrientation orientation;
Lines 142-147 bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula a/Source/WebCore/platform/ScrollableArea.cpp_sec3
142
    return scrollAnimator().scroll(orientation, granularity, step, multiplier);
163
    return scrollAnimator().scroll(orientation, granularity, step, multiplier);
143
}
164
}
144
165
166
void ScrollableArea::scrollToOffsetWithAnimation(const FloatPoint& offset, ScrollClamping)
167
{
168
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffset " << offset);
169
    scrollAnimator().scrollToOffset(offset);
170
}
171
145
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
172
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
146
{
173
{
147
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
174
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
Lines 221-235 bool ScrollableArea::handleTouchEvent(const PlatformTouchEvent& touchEvent) a/Source/WebCore/platform/ScrollableArea.cpp_sec4
221
// NOTE: Only called from Internals for testing.
248
// NOTE: Only called from Internals for testing.
222
void ScrollableArea::setScrollOffsetFromInternals(const ScrollOffset& offset)
249
void ScrollableArea::setScrollOffsetFromInternals(const ScrollOffset& offset)
223
{
250
{
251
    ScrollPosition position = scrollPositionFromOffset(offset);
252
    if (requestScrollPositionUpdate(position))
253
        return;
224
    setScrollOffsetFromAnimation(offset);
254
    setScrollOffsetFromAnimation(offset);
225
}
255
}
226
256
227
void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset)
257
void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset)
228
{
258
{
229
    ScrollPosition position = scrollPositionFromOffset(offset);
259
    ScrollPosition position = scrollPositionFromOffset(offset);
230
    if (requestScrollPositionUpdate(position))
231
        return;
232
233
    scrollPositionChanged(position);
260
    scrollPositionChanged(position);
234
}
261
}
235
262
- a/Source/WebCore/platform/ScrollableArea.h +17 lines
Lines 62-68 inline int offsetForOrientation(ScrollOffset offset, ScrollbarOrientation orient a/Source/WebCore/platform/ScrollableArea.h_sec1
62
62
63
class ScrollableArea : public CanMakeWeakPtr<ScrollableArea> {
63
class ScrollableArea : public CanMakeWeakPtr<ScrollableArea> {
64
public:
64
public:
65
    WEBCORE_EXPORT bool isScrollInProgress();
66
    bool isWebScrollAnimationInProgress();
67
    ScrollBehaviorStatus currentScrollBehaviorStatus() const { return m_currentScrollBehaviorStatus; }
68
    void setScrollBehaviorStatus(ScrollBehaviorStatus status) { m_currentScrollBehaviorStatus = status; }
69
65
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
70
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
71
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
66
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
72
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
67
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
73
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
68
74
Lines 242-247 public: a/Source/WebCore/platform/ScrollableArea.h_sec2
242
    ScrollType currentScrollType() const { return static_cast<ScrollType>(m_currentScrollType); }
248
    ScrollType currentScrollType() const { return static_cast<ScrollType>(m_currentScrollType); }
243
    void setCurrentScrollType(ScrollType scrollType) { m_currentScrollType = static_cast<unsigned>(scrollType); }
249
    void setCurrentScrollType(ScrollType scrollType) { m_currentScrollType = static_cast<unsigned>(scrollType); }
244
250
251
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
252
    ScrollBehaviorType currentScrollBehaviorType() const { return static_cast<ScrollBehaviorType>(m_currentScrollBehaviorType); }
253
    void setCurrentScrollBehaviorType(ScrollBehaviorType scrollBehaviorType) { m_currentScrollBehaviorType = static_cast<unsigned>(scrollBehaviorType); }
254
#endif
255
245
    bool scrollShouldClearLatchedState() const { return m_scrollShouldClearLatchedState; }
256
    bool scrollShouldClearLatchedState() const { return m_scrollShouldClearLatchedState; }
246
    void setScrollShouldClearLatchedState(bool shouldClear) { m_scrollShouldClearLatchedState = shouldClear; }
257
    void setScrollShouldClearLatchedState(bool shouldClear) { m_scrollShouldClearLatchedState = shouldClear; }
247
258
Lines 378-383 private: a/Source/WebCore/platform/ScrollableArea.h_sec3
378
    unsigned m_currentVerticalSnapPointIndex { 0 };
389
    unsigned m_currentVerticalSnapPointIndex { 0 };
379
#endif
390
#endif
380
391
392
    ScrollBehaviorStatus m_currentScrollBehaviorStatus { ScrollBehaviorStatus::NotInAnimation };
393
381
    // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis
394
    // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis
382
    // if there is any reversed direction or writing-mode. The combinations are:
395
    // if there is any reversed direction or writing-mode. The combinations are:
383
    // writing-mode / direction     scrollOrigin.x() set    scrollOrigin.y() set
396
    // writing-mode / direction     scrollOrigin.x() set    scrollOrigin.y() set
Lines 403-408 private: a/Source/WebCore/platform/ScrollableArea.h_sec4
403
    unsigned m_scrollOriginChanged : 1;
416
    unsigned m_scrollOriginChanged : 1;
404
    unsigned m_currentScrollType : 1; // ScrollType
417
    unsigned m_currentScrollType : 1; // ScrollType
405
    unsigned m_scrollShouldClearLatchedState : 1;
418
    unsigned m_scrollShouldClearLatchedState : 1;
419
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
420
    unsigned m_currentScrollBehaviorType : 1;
421
#endif
422
406
};
423
};
407
424
408
} // namespace WebCore
425
} // namespace WebCore
- a/Source/WebCore/platform/generic/ScrollAnimatorGeneric.cpp +2 lines
Lines 162-167 void ScrollAnimatorGeneric::willEndLiveResize() a/Source/WebCore/platform/generic/ScrollAnimatorGeneric.cpp_sec1
162
162
163
void ScrollAnimatorGeneric::updatePosition(FloatPoint&& position)
163
void ScrollAnimatorGeneric::updatePosition(FloatPoint&& position)
164
{
164
{
165
    if (m_scrollableArea.requestScrollPositionUpdate(roundedIntPoint(position)))
166
        return;
165
    FloatSize delta = position - m_currentPosition;
167
    FloatSize delta = position - m_currentPosition;
166
    m_currentPosition = WTFMove(position);
168
    m_currentPosition = WTFMove(position);
167
    notifyPositionChanged(delta);
169
    notifyPositionChanged(delta);
- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm +1 lines
Lines 1155-1160 void ScrollAnimatorMac::notifyContentAreaScrolled(const FloatSize& delta) a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm_sec1
1155
1155
1156
void ScrollAnimatorMac::cancelAnimations()
1156
void ScrollAnimatorMac::cancelAnimations()
1157
{
1157
{
1158
    ScrollAnimator::cancelAnimations();
1158
    m_haveScrolledSincePageLoad = false;
1159
    m_haveScrolledSincePageLoad = false;
1159
1160
1160
    if (scrollbarPaintTimerIsActive())
1161
    if (scrollbarPaintTimerIsActive())
- a/Source/WebCore/rendering/RenderBox.cpp -4 / +12 lines
Lines 581-600 static void setupWheelEventMonitor(RenderLayer& layer) a/Source/WebCore/rendering/RenderBox.cpp_sec1
581
    layer.scrollAnimator().setWheelEventTestMonitor(page.wheelEventTestMonitor());
581
    layer.scrollAnimator().setWheelEventTestMonitor(page.wheelEventTestMonitor());
582
}
582
}
583
583
584
void RenderBox::setScrollLeft(int newLeft, ScrollType scrollType, ScrollClamping clamping)
584
void RenderBox::setScrollLeft(int newLeft, ScrollType scrollType, bool animated, ScrollClamping clamping)
585
{
585
{
586
    if (!hasOverflowClip() || !layer())
586
    if (!hasOverflowClip() || !layer())
587
        return;
587
        return;
588
    setupWheelEventMonitor(*layer());
588
    setupWheelEventMonitor(*layer());
589
    layer()->scrollToXPosition(newLeft, scrollType, clamping);
589
    layer()->scrollToXPosition(newLeft, scrollType, animated, clamping);
590
}
590
}
591
591
592
void RenderBox::setScrollTop(int newTop, ScrollType scrollType, ScrollClamping clamping)
592
void RenderBox::setScrollTop(int newTop, ScrollType scrollType, bool animated, ScrollClamping clamping)
593
{
593
{
594
    if (!hasOverflowClip() || !layer())
594
    if (!hasOverflowClip() || !layer())
595
        return;
595
        return;
596
    setupWheelEventMonitor(*layer());
596
    setupWheelEventMonitor(*layer());
597
    layer()->scrollToYPosition(newTop, scrollType, clamping);
597
    layer()->scrollToYPosition(newTop, scrollType, animated, clamping);
598
}
599
600
void RenderBox::setScrollPosition(const ScrollPosition& position, ScrollType scrollType, bool animated, ScrollClamping clamping)
601
{
602
    if (!hasOverflowClip() || !layer())
603
        return;
604
    setupWheelEventMonitor(*layer());
605
    layer()->scrollToPosition(position, scrollType, animated, clamping);
598
}
606
}
599
607
600
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
608
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
- a/Source/WebCore/rendering/RenderBox.h -2 / +3 lines
Lines 247-254 public: a/Source/WebCore/rendering/RenderBox.h_sec1
247
    virtual int scrollTop() const;
247
    virtual int scrollTop() const;
248
    virtual int scrollWidth() const;
248
    virtual int scrollWidth() const;
249
    virtual int scrollHeight() const;
249
    virtual int scrollHeight() const;
250
    virtual void setScrollLeft(int, ScrollType, ScrollClamping = ScrollClamping::Clamped);
250
    virtual void setScrollLeft(int, ScrollType, bool animated = false, ScrollClamping = ScrollClamping::Clamped);
251
    virtual void setScrollTop(int, ScrollType, ScrollClamping = ScrollClamping::Clamped);
251
    virtual void setScrollTop(int, ScrollType, bool animated = false, ScrollClamping = ScrollClamping::Clamped);
252
    void setScrollPosition(const ScrollPosition&, ScrollType, bool animated = false, ScrollClamping = ScrollClamping::Clamped);
252
253
253
    LayoutUnit marginTop() const override { return m_marginBox.top(); }
254
    LayoutUnit marginTop() const override { return m_marginBox.top(); }
254
    LayoutUnit marginBottom() const override { return m_marginBox.bottom(); }
255
    LayoutUnit marginBottom() const override { return m_marginBox.bottom(); }
- a/Source/WebCore/rendering/RenderLayer.cpp -15 / +76 lines
Lines 116-121 a/Source/WebCore/rendering/RenderLayer.cpp_sec1
116
#include "ScaleTransformOperation.h"
116
#include "ScaleTransformOperation.h"
117
#include "ScriptDisallowedScope.h"
117
#include "ScriptDisallowedScope.h"
118
#include "ScrollAnimator.h"
118
#include "ScrollAnimator.h"
119
#include "ScrollBehavior.h"
119
#include "Scrollbar.h"
120
#include "Scrollbar.h"
120
#include "ScrollbarTheme.h"
121
#include "ScrollbarTheme.h"
121
#include "ScrollingCoordinator.h"
122
#include "ScrollingCoordinator.h"
Lines 2547-2562 void RenderLayer::applyPostLayoutScrollPositionIfNeeded() a/Source/WebCore/rendering/RenderLayer.cpp_sec2
2547
    m_postLayoutScrollPosition = WTF::nullopt;
2548
    m_postLayoutScrollPosition = WTF::nullopt;
2548
}
2549
}
2549
2550
2550
void RenderLayer::scrollToXPosition(int x, ScrollType scrollType, ScrollClamping clamping)
2551
void RenderLayer::scrollToXPosition(int x, ScrollType scrollType, bool animated, ScrollClamping clamping)
2551
{
2552
{
2552
    ScrollPosition position(x, m_scrollPosition.y());
2553
    ScrollPosition position(x, m_scrollPosition.y());
2553
    scrollToOffset(scrollOffsetFromPosition(position), scrollType, clamping);
2554
    scrollToPosition(position, scrollType, animated, clamping);
2554
}
2555
}
2555
2556
2556
void RenderLayer::scrollToYPosition(int y, ScrollType scrollType, ScrollClamping clamping)
2557
void RenderLayer::scrollToYPosition(int y, ScrollType scrollType, bool animated, ScrollClamping clamping)
2557
{
2558
{
2558
    ScrollPosition position(m_scrollPosition.x(), y);
2559
    ScrollPosition position(m_scrollPosition.x(), y);
2559
    scrollToOffset(scrollOffsetFromPosition(position), scrollType, clamping);
2560
    scrollToPosition(position, scrollType, animated, clamping);
2561
}
2562
2563
void RenderLayer::scrollToPosition(const ScrollPosition& position, ScrollType scrollType, bool animated, ScrollClamping clamping)
2564
{
2565
    if (animated)
2566
        scrollToOffsetWithAnimation(scrollOffsetFromPosition(position), scrollType, clamping);
2567
    else
2568
        scrollToOffset(scrollOffsetFromPosition(position), scrollType, clamping);
2560
}
2569
}
2561
2570
2562
ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset& scrollOffset) const
2571
ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset& scrollOffset) const
Lines 2566-2588 ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset& scrollOffset) co a/Source/WebCore/rendering/RenderLayer.cpp_sec3
2566
2575
2567
void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType scrollType, ScrollClamping clamping)
2576
void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType scrollType, ScrollClamping clamping)
2568
{
2577
{
2578
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
2579
    setCurrentScrollBehaviorType(ScrollBehaviorType::Instant);
2580
#endif
2581
    if (isWebScrollAnimationInProgress())
2582
        scrollAnimator().cancelAnimations();
2583
2569
    ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2584
    ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2570
    if (clampedScrollOffset == this->scrollOffset())
2585
    if (clampedScrollOffset == this->scrollOffset()) {
2586
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
2587
        // If UIScrollView is during scroll animation, the scroll offset of web side might be overriden.
2588
        // So we need to requestScrollPositionUpdate here, and check in UI side. If the scroll offset in UI side
2589
        // is different, the correct scroll offset need to sync back to Web side.
2590
        if (currentScrollBehaviorStatus() == ScrollBehaviorStatus::InUINativeAnimation)
2591
            requestScrollPositionUpdate(scrollPositionFromOffset(clampedScrollOffset));
2592
#endif
2571
        return;
2593
        return;
2594
    }
2572
2595
2573
    auto previousScrollType = currentScrollType();
2596
    auto previousScrollType = currentScrollType();
2574
    setCurrentScrollType(scrollType);
2597
    setCurrentScrollType(scrollType);
2575
2598
2576
    bool handled = false;
2599
    bool handled = false;
2577
#if ENABLE(ASYNC_SCROLLING)
2600
#if ENABLE(ASYNC_SCROLLING)
2578
    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
2601
    handled = requestScrollPositionUpdate(scrollPositionFromOffset(clampedScrollOffset));
2579
        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(clampedScrollOffset));
2580
#endif
2602
#endif
2581
2603
2582
    if (!handled)
2604
    if (!handled)
2583
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2605
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2584
2606
2585
    setCurrentScrollType(previousScrollType);
2607
    setCurrentScrollType(previousScrollType);
2608
    setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
2609
}
2610
2611
bool RenderLayer::requestScrollPositionUpdate(const ScrollPosition& position)
2612
{
2613
#if ENABLE(ASYNC_SCROLLING)
2614
    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
2615
        return scrollingCoordinator->requestScrollPositionUpdate(*this, position);
2616
#endif
2617
    return false;
2618
}
2619
2620
void RenderLayer::scrollToOffsetWithAnimation(const ScrollOffset& offset, ScrollType scrollType, ScrollClamping clamping)
2621
{
2622
    auto previousScrollType = currentScrollType();
2623
    setCurrentScrollType(scrollType);
2624
2625
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
2626
    setCurrentScrollBehaviorType(ScrollBehaviorType::Smooth);
2627
    if (requestScrollPositionUpdate(scrollPositionFromOffset(offset))) {
2628
        setCurrentScrollType(previousScrollType);
2629
        return;
2630
    }
2631
#endif
2632
2633
    ScrollOffset newScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(offset) : offset;
2634
    if (isWebScrollAnimationInProgress())
2635
        scrollAnimator().cancelAnimations();
2636
    if (newScrollOffset != this->scrollOffset())
2637
        ScrollableArea::scrollToOffsetWithAnimation(newScrollOffset);
2638
    setCurrentScrollType(previousScrollType);
2586
}
2639
}
2587
2640
2588
void RenderLayer::scrollTo(const ScrollPosition& position)
2641
void RenderLayer::scrollTo(const ScrollPosition& position)
Lines 2617-2623 void RenderLayer::scrollTo(const ScrollPosition& position) a/Source/WebCore/rendering/RenderLayer.cpp_sec4
2617
#endif
2670
#endif
2618
    }
2671
    }
2619
    
2672
    
2620
    if (m_scrollPosition == newPosition) {
2673
    if (m_scrollPosition == newPosition && !isScrollInProgress()) {
2621
        // FIXME: Nothing guarantees we get a scrollTo() with an unchanged position at the end of a user gesture.
2674
        // FIXME: Nothing guarantees we get a scrollTo() with an unchanged position at the end of a user gesture.
2622
        // The ScrollingCoordinator probably needs to message the main thread when a gesture ends.
2675
        // The ScrollingCoordinator probably needs to message the main thread when a gesture ends.
2623
        if (requiresScrollPositionReconciliation()) {
2676
        if (requiresScrollPositionReconciliation()) {
Lines 2735-2740 bool RenderLayer::allowsCurrentScroll() const a/Source/WebCore/rendering/RenderLayer.cpp_sec5
2735
2788
2736
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2789
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2737
{
2790
{
2791
    // FIXME (https://webkit.org/b/189907): Make this work with nested scrollable boxes when a smooth scrolling must be performed.
2738
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2792
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2739
2793
2740
    RenderLayer* parentLayer = nullptr;
2794
    RenderLayer* parentLayer = nullptr;
Lines 2762-2771 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec6
2762
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2816
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2763
2817
2764
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2818
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2765
        if (clampedScrollOffset != scrollOffset()) {
2819
        if (isScrollInProgress() || clampedScrollOffset != scrollOffset()) {
2766
            ScrollOffset oldScrollOffset = scrollOffset();
2820
            ScrollOffset oldScrollOffset = scrollOffset();
2767
            scrollToOffset(clampedScrollOffset);
2821
            bool animated = (box->element() && useSmoothScrolling(options.behavior, *box->element()));
2768
            IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2822
            scrollToPosition(scrollPositionFromOffset(clampedScrollOffset), currentScrollType(), animated);
2823
            IntSize scrollOffsetDifference = clampedScrollOffset - oldScrollOffset;
2769
            localExposeRect.move(-scrollOffsetDifference);
2824
            localExposeRect.move(-scrollOffsetDifference);
2770
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
2825
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
2771
        }
2826
        }
Lines 2785-2794 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec7
2785
                LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
2840
                LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
2786
                LayoutRect exposeRect = getRectToExpose(viewRect, absoluteRect, insideFixed, options.alignX, options.alignY);
2841
                LayoutRect exposeRect = getRectToExpose(viewRect, absoluteRect, insideFixed, options.alignX, options.alignY);
2787
2842
2788
                IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
2843
                IntPoint scrollPosition(roundedIntPoint(exposeRect.location()));
2789
                // Adjust offsets if they're outside of the allowable range.
2844
                // Adjust offsets if they're outside of the allowable range.
2790
                scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2845
                scrollPosition = scrollPosition.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2791
                frameView.setScrollPosition(scrollOffset);
2846
                // FIXME: Should we use contentDocument()->scrollingElement()?
2847
                // See https://github.com/w3c/csswg-drafts/issues/2977
2848
                bool animated = ownerElement->contentDocument() && ownerElement->contentDocument()->documentElement() && useSmoothScrolling(options.behavior, *ownerElement->contentDocument()->documentElement());
2849
                frameView.setScrollPosition(scrollPosition, animated);
2792
2850
2793
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2851
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2794
                    parentLayer = ownerElement->renderer()->enclosingLayer();
2852
                    parentLayer = ownerElement->renderer()->enclosingLayer();
Lines 2827-2833 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec8
2827
            // Avoid scrolling to the rounded value of revealRect.location() if we don't actually need to scroll
2885
            // Avoid scrolling to the rounded value of revealRect.location() if we don't actually need to scroll
2828
            if (revealRect != viewRect) {
2886
            if (revealRect != viewRect) {
2829
                ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2887
                ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2830
                frameView.setScrollPosition(clampedScrollPosition);
2888
                // FIXME: Should we use document()->scrollingElement()?
2889
                // See https://github.com/w3c/csswg-drafts/issues/2977
2890
                bool animated = renderer().document().documentElement() && useSmoothScrolling(options.behavior, *renderer().document().documentElement());
2891
                frameView.setScrollPosition(clampedScrollPosition, animated);
2831
            }
2892
            }
2832
2893
2833
            // This is the outermost view of a web page, so after scrolling this view we
2894
            // This is the outermost view of a web page, so after scrolling this view we
- a/Source/WebCore/rendering/RenderLayer.h -2 / +8 lines
Lines 50-55 a/Source/WebCore/rendering/RenderLayer.h_sec1
50
#include "PaintInfo.h"
50
#include "PaintInfo.h"
51
#include "RenderBox.h"
51
#include "RenderBox.h"
52
#include "RenderPtr.h"
52
#include "RenderPtr.h"
53
#include "ScrollBehavior.h"
53
#include "ScrollableArea.h"
54
#include "ScrollableArea.h"
54
#include <memory>
55
#include <memory>
55
#include <wtf/WeakPtr.h>
56
#include <wtf/WeakPtr.h>
Lines 134-139 struct ScrollRectToVisibleOptions { a/Source/WebCore/rendering/RenderLayer.h_sec2
134
    const ScrollAlignment& alignX { ScrollAlignment::alignCenterIfNeeded };
135
    const ScrollAlignment& alignX { ScrollAlignment::alignCenterIfNeeded };
135
    const ScrollAlignment& alignY { ScrollAlignment::alignCenterIfNeeded };
136
    const ScrollAlignment& alignY { ScrollAlignment::alignCenterIfNeeded };
136
    ShouldAllowCrossOriginScrolling shouldAllowCrossOriginScrolling { ShouldAllowCrossOriginScrolling::No };
137
    ShouldAllowCrossOriginScrolling shouldAllowCrossOriginScrolling { ShouldAllowCrossOriginScrolling::No };
138
    ScrollBehavior behavior { ScrollBehavior::Auto };
137
};
139
};
138
140
139
class RenderLayer final : public ScrollableArea {
141
class RenderLayer final : public ScrollableArea {
Lines 434-442 public: a/Source/WebCore/rendering/RenderLayer.h_sec3
434
    void scrollByRecursively(const IntSize& delta, ScrollableArea** scrolledArea = nullptr);
436
    void scrollByRecursively(const IntSize& delta, ScrollableArea** scrolledArea = nullptr);
435
437
436
    WEBCORE_EXPORT void scrollToOffset(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
438
    WEBCORE_EXPORT void scrollToOffset(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
439
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
437
440
438
    void scrollToXPosition(int x, ScrollType, ScrollClamping = ScrollClamping::Clamped);
441
    bool requestScrollPositionUpdate(const ScrollPosition&) override;
439
    void scrollToYPosition(int y, ScrollType, ScrollClamping = ScrollClamping::Clamped);
442
443
    void scrollToXPosition(int x, ScrollType, bool animated, ScrollClamping = ScrollClamping::Clamped);
444
    void scrollToYPosition(int y, ScrollType, bool animated, ScrollClamping = ScrollClamping::Clamped);
445
    void scrollToPosition(const ScrollPosition&, ScrollType, bool animated, ScrollClamping = ScrollClamping::Clamped);
440
446
441
    // These are only used by marquee.
447
    // These are only used by marquee.
442
    void scrollToXOffset(int x) { scrollToOffset(ScrollOffset(x, scrollOffset().y()), ScrollType::Programmatic, ScrollClamping::Unclamped); }
448
    void scrollToXOffset(int x) { scrollToOffset(ScrollOffset(x, scrollOffset().y()), ScrollType::Programmatic, ScrollClamping::Unclamped); }
- a/Source/WebCore/rendering/RenderListBox.cpp -2 / +2 lines
Lines 744-750 int RenderListBox::scrollLeft() const a/Source/WebCore/rendering/RenderListBox.cpp_sec1
744
    return 0;
744
    return 0;
745
}
745
}
746
746
747
void RenderListBox::setScrollLeft(int, ScrollType, ScrollClamping)
747
void RenderListBox::setScrollLeft(int, ScrollType, bool, ScrollClamping)
748
{
748
{
749
}
749
}
750
750
Lines 761-767 static void setupWheelEventTestMonitor(RenderListBox& renderer) a/Source/WebCore/rendering/RenderListBox.cpp_sec2
761
    renderer.scrollAnimator().setWheelEventTestMonitor(renderer.page().wheelEventTestMonitor());
761
    renderer.scrollAnimator().setWheelEventTestMonitor(renderer.page().wheelEventTestMonitor());
762
}
762
}
763
763
764
void RenderListBox::setScrollTop(int newTop, ScrollType, ScrollClamping)
764
void RenderListBox::setScrollTop(int newTop, ScrollType, bool, ScrollClamping)
765
{
765
{
766
    // Determine an index and scroll to it.    
766
    // Determine an index and scroll to it.    
767
    int index = newTop / itemHeight();
767
    int index = newTop / itemHeight();
- a/Source/WebCore/rendering/RenderListBox.h -2 / +2 lines
Lines 106-113 private: a/Source/WebCore/rendering/RenderListBox.h_sec1
106
    int scrollTop() const override;
106
    int scrollTop() const override;
107
    int scrollWidth() const override;
107
    int scrollWidth() const override;
108
    int scrollHeight() const override;
108
    int scrollHeight() const override;
109
    void setScrollLeft(int, ScrollType, ScrollClamping) override;
109
    void setScrollLeft(int, ScrollType, bool, ScrollClamping) override;
110
    void setScrollTop(int, ScrollType, ScrollClamping) override;
110
    void setScrollTop(int, ScrollType, bool, ScrollClamping) override;
111
111
112
    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
112
    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
113
113
- a/Source/WebCore/rendering/RenderObject.cpp +3 lines
Lines 427-433 bool RenderObject::scrollRectToVisible(const LayoutRect& absoluteRect, bool insi a/Source/WebCore/rendering/RenderObject.cpp_sec1
427
    if (!enclosingLayer)
427
    if (!enclosingLayer)
428
        return false;
428
        return false;
429
429
430
    auto previousScrollType = enclosingLayer->currentScrollType();
431
    enclosingLayer->setCurrentScrollType(ScrollType::Programmatic);
430
    enclosingLayer->scrollRectToVisible(absoluteRect, insideFixed, options);
432
    enclosingLayer->scrollRectToVisible(absoluteRect, insideFixed, options);
433
    enclosingLayer->setCurrentScrollType(previousScrollType);
431
    return true;
434
    return true;
432
}
435
}
433
436
- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp -2 / +2 lines
Lines 376-388 int RenderTextControlSingleLine::scrollTop() const a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp_sec1
376
    return RenderBlockFlow::scrollTop();
376
    return RenderBlockFlow::scrollTop();
377
}
377
}
378
378
379
void RenderTextControlSingleLine::setScrollLeft(int newLeft, ScrollType, ScrollClamping)
379
void RenderTextControlSingleLine::setScrollLeft(int newLeft, ScrollType, bool, ScrollClamping)
380
{
380
{
381
    if (innerTextElement())
381
    if (innerTextElement())
382
        innerTextElement()->setScrollLeft(newLeft);
382
        innerTextElement()->setScrollLeft(newLeft);
383
}
383
}
384
384
385
void RenderTextControlSingleLine::setScrollTop(int newTop, ScrollType, ScrollClamping)
385
void RenderTextControlSingleLine::setScrollTop(int newTop, ScrollType, bool, ScrollClamping)
386
{
386
{
387
    if (innerTextElement())
387
    if (innerTextElement())
388
        innerTextElement()->setScrollTop(newTop);
388
        innerTextElement()->setScrollTop(newTop);
- a/Source/WebCore/rendering/RenderTextControlSingleLine.h -2 / +2 lines
Lines 57-64 private: a/Source/WebCore/rendering/RenderTextControlSingleLine.h_sec1
57
    int scrollTop() const override;
57
    int scrollTop() const override;
58
    int scrollWidth() const override;
58
    int scrollWidth() const override;
59
    int scrollHeight() const override;
59
    int scrollHeight() const override;
60
    void setScrollLeft(int, ScrollType, ScrollClamping) override;
60
    void setScrollLeft(int, ScrollType, bool, ScrollClamping) override;
61
    void setScrollTop(int, ScrollType, ScrollClamping) override;
61
    void setScrollTop(int, ScrollType, bool, ScrollClamping) override;
62
    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) final;
62
    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) final;
63
    bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) final;
63
    bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) final;
64
64
- a/Source/WebCore/rendering/style/RenderStyle.h +6 lines
Lines 736-741 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
736
    bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
736
    bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
737
#endif
737
#endif
738
738
739
    bool useSmoothScrolling() const { return m_rareNonInheritedData->useSmoothScrolling; }
740
739
#if ENABLE(TEXT_AUTOSIZING)
741
#if ENABLE(TEXT_AUTOSIZING)
740
    TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
742
    TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
741
    AutosizeStatus autosizeStatus() const;
743
    AutosizeStatus autosizeStatus() const;
Lines 1267-1272 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
1267
    void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
1269
    void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
1268
#endif
1270
#endif
1269
1271
1272
    void setUseSmoothScrolling(bool v) { SET_VAR(m_rareNonInheritedData, useSmoothScrolling, v); }
1273
1270
#if ENABLE(TEXT_AUTOSIZING)
1274
#if ENABLE(TEXT_AUTOSIZING)
1271
    void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
1275
    void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
1272
    void setAutosizeStatus(AutosizeStatus);
1276
    void setAutosizeStatus(AutosizeStatus);
Lines 1704-1709 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec3
1704
    static bool initialUseTouchOverflowScrolling() { return false; }
1708
    static bool initialUseTouchOverflowScrolling() { return false; }
1705
#endif
1709
#endif
1706
1710
1711
    static bool initialUseSmoothScrolling() { return false; }
1712
1707
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1713
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1708
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1714
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1709
1715
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +3 lines
Lines 82-87 StyleRareNonInheritedData::StyleRareNonInheritedData() a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec1
82
#if ENABLE(POINTER_EVENTS)
82
#if ENABLE(POINTER_EVENTS)
83
    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
83
    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
84
#endif
84
#endif
85
    , useSmoothScrolling(static_cast<unsigned>(RenderStyle::initialUseSmoothScrolling()))
85
    , pageSizeType(PAGE_SIZE_AUTO)
86
    , pageSizeType(PAGE_SIZE_AUTO)
86
    , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
87
    , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
87
    , backfaceVisibility(static_cast<unsigned>(RenderStyle::initialBackfaceVisibility()))
88
    , backfaceVisibility(static_cast<unsigned>(RenderStyle::initialBackfaceVisibility()))
Lines 175-180 inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec2
175
#if ENABLE(POINTER_EVENTS)
176
#if ENABLE(POINTER_EVENTS)
176
    , touchActions(o.touchActions)
177
    , touchActions(o.touchActions)
177
#endif
178
#endif
179
    , useSmoothScrolling(o.useSmoothScrolling)
178
    , pageSizeType(o.pageSizeType)
180
    , pageSizeType(o.pageSizeType)
179
    , transformStyle3D(o.transformStyle3D)
181
    , transformStyle3D(o.transformStyle3D)
180
    , backfaceVisibility(o.backfaceVisibility)
182
    , backfaceVisibility(o.backfaceVisibility)
Lines 287-292 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec3
287
#if ENABLE(POINTER_EVENTS)
289
#if ENABLE(POINTER_EVENTS)
288
        && touchActions == o.touchActions
290
        && touchActions == o.touchActions
289
#endif
291
#endif
292
        && useSmoothScrolling == o.useSmoothScrolling
290
#if ENABLE(CSS_COMPOSITING)
293
#if ENABLE(CSS_COMPOSITING)
291
        && effectiveBlendMode == o.effectiveBlendMode
294
        && effectiveBlendMode == o.effectiveBlendMode
292
        && isolation == o.isolation
295
        && isolation == o.isolation
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h +2 lines
Lines 175-180 public: a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h_sec1
175
    unsigned touchActions : 6; // TouchAction
175
    unsigned touchActions : 6; // TouchAction
176
#endif
176
#endif
177
177
178
    unsigned useSmoothScrolling : 1; // ScrollBehavior
179
178
    unsigned pageSizeType : 2; // PageSizeType
180
    unsigned pageSizeType : 2; // PageSizeType
179
    unsigned transformStyle3D : 1; // TransformStyle3D
181
    unsigned transformStyle3D : 1; // TransformStyle3D
180
    unsigned backfaceVisibility : 1; // BackfaceVisibility
182
    unsigned backfaceVisibility : 1; // BackfaceVisibility
- a/Source/WebCore/style/StyleBuilderConverter.h +6 lines
Lines 129-134 public: a/Source/WebCore/style/StyleBuilderConverter.h_sec1
129
    static bool convertOverflowScrolling(BuilderState&, const CSSValue&);
129
    static bool convertOverflowScrolling(BuilderState&, const CSSValue&);
130
#endif
130
#endif
131
    static FontFeatureSettings convertFontFeatureSettings(BuilderState&, const CSSValue&);
131
    static FontFeatureSettings convertFontFeatureSettings(BuilderState&, const CSSValue&);
132
    static bool convertSmoothScrolling(BuilderState&, const CSSValue&);
132
    static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
133
    static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
133
    static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
134
    static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
134
    static Optional<FontSelectionValue> convertFontStyleFromValue(const CSSValue&);
135
    static Optional<FontSelectionValue> convertFontStyleFromValue(const CSSValue&);
Lines 1403-1408 inline bool BuilderConverter::convertOverflowScrolling(BuilderState&, const CSSV a/Source/WebCore/style/StyleBuilderConverter.h_sec2
1403
}
1404
}
1404
#endif
1405
#endif
1405
1406
1407
inline bool BuilderConverter::convertSmoothScrolling(BuilderState&, const CSSValue& value)
1408
{
1409
    return downcast<CSSPrimitiveValue>(value).valueID() == CSSValueSmooth;
1410
}
1411
1406
inline SVGLengthValue BuilderConverter::convertSVGLengthValue(BuilderState&, const CSSValue& value)
1412
inline SVGLengthValue BuilderConverter::convertSVGLengthValue(BuilderState&, const CSSValue& value)
1407
{
1413
{
1408
    return SVGLengthValue::fromCSSPrimitiveValue(downcast<CSSPrimitiveValue>(value));
1414
    return SVGLengthValue::fromCSSPrimitiveValue(downcast<CSSPrimitiveValue>(value));
- a/Source/WebCore/testing/Internals.cpp -1 / +1 lines
Lines 1764-1770 ExceptionOr<void> Internals::unconstrainedScrollTo(Element& element, double x, d a/Source/WebCore/testing/Internals.cpp_sec1
1764
    if (!document || !document->view())
1764
    if (!document || !document->view())
1765
        return Exception { InvalidAccessError };
1765
        return Exception { InvalidAccessError };
1766
1766
1767
    element.scrollTo({ x, y }, ScrollClamping::Unclamped);
1767
    element.scrollTo(ScrollToOptions(x, y), ScrollClamping::Unclamped);
1768
    return { };
1768
    return { };
1769
}
1769
}
1770
1770
- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp -1 / +7 lines
Lines 152-157 void ArgumentCoder<ScrollingStateScrollingNode>::encode(Encoder& encoder, const a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec1
152
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollableAreaParams, scrollableAreaParameters)
152
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollableAreaParams, scrollableAreaParameters)
153
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPosition)
153
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPosition)
154
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
154
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
155
    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionWithAnimation)
155
156
156
    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
157
    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
157
        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrollContainerLayer());
158
        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrollContainerLayer());
Lines 260-266 bool ArgumentCoder<ScrollingStateScrollingNode>::decode(Decoder& decoder, Scroll a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec2
260
        if (!decoder.decode(representsProgrammaticScroll))
261
        if (!decoder.decode(representsProgrammaticScroll))
261
            return false;
262
            return false;
262
263
263
        node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll);
264
        bool scrollWithAnimation;
265
        if (!decoder.decode(scrollWithAnimation))
266
            return false;
267
268
        node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll, scrollWithAnimation);
264
    }
269
    }
265
270
266
    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
271
    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
Lines 608-613 static void dump(TextStream& ts, const ScrollingStateScrollingNode& node, bool c a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec3
608
    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
613
    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
609
        ts.dumpProperty("requested-scroll-position", node.requestedScrollPosition());
614
        ts.dumpProperty("requested-scroll-position", node.requestedScrollPosition());
610
        ts.dumpProperty("requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll());
615
        ts.dumpProperty("requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll());
616
        ts.dumpProperty("requested-scroll-position-with-animation", node.requestedScrollPositionWithAnimation());
611
    }
617
    }
612
618
613
    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
619
    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
- a/Source/WebKit/Shared/WebPreferences.yaml +7 lines
Lines 1309-1314 BlockingOfSmallPluginsEnabled: a/Source/WebKit/Shared/WebPreferences.yaml_sec1
1309
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1309
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1310
  category: internal
1310
  category: internal
1311
1311
1312
CSSOMViewSmoothScrollingEnabled:
1313
  type: bool
1314
  defaultValue: true
1315
  humanReadableName: "CSSOM View Smooth Scrolling"
1316
  humanReadableDescription: "Enable DOM API and CSS property for 'smooth' scroll behavior"
1317
  category: experimental
1318
1312
WebAnimationsEnabled:
1319
WebAnimationsEnabled:
1313
  type: bool
1320
  type: bool
1314
  defaultValue: true
1321
  defaultValue: true
- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm -4 / +22 lines
Lines 1616-1621 static inline bool pointsEqualInDevicePixels(CGPoint a, CGPoint b, float deviceS a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm_sec1
1616
        && fabs(a.y * deviceScaleFactor - b.y * deviceScaleFactor) < std::numeric_limits<float>::epsilon();
1616
        && fabs(a.y * deviceScaleFactor - b.y * deviceScaleFactor) < std::numeric_limits<float>::epsilon();
1617
}
1617
}
1618
1618
1619
static inline bool pointsEqualInRoundToDevicePixel(CGPoint a, CGPoint b, float deviceScaleFactor)
1620
{
1621
    return CGRound(a.x * deviceScaleFactor) == CGRound(b.x * deviceScaleFactor)
1622
        && CGRound(a.y * deviceScaleFactor) == CGRound(b.y * deviceScaleFactor);
1623
}
1619
static CGSize roundScrollViewContentSize(const WebKit::WebPageProxy& page, CGSize contentSize)
1624
static CGSize roundScrollViewContentSize(const WebKit::WebPageProxy& page, CGSize contentSize)
1620
{
1625
{
1621
    float deviceScaleFactor = page.deviceScaleFactor();
1626
    float deviceScaleFactor = page.deviceScaleFactor();
Lines 2340-2348 static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm_sec2
2340
    return contentOffset.constrainedBetween(WebCore::FloatPoint(), WebCore::FloatPoint(maximumContentOffset));
2345
    return contentOffset.constrainedBetween(WebCore::FloatPoint(), WebCore::FloatPoint(maximumContentOffset));
2341
}
2346
}
2342
2347
2343
- (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin
2348
- (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin animated:(BOOL)animated
2344
{
2349
{
2345
    if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing)
2350
    // Animated scrolling shouldn't be skipped.
2351
    if (!animated && (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing))
2346
        return;
2352
        return;
2347
2353
2348
    WebCore::FloatPoint contentOffset = WebCore::ScrollableArea::scrollOffsetFromPosition(scrollPosition, toFloatSize(scrollOrigin));
2354
    WebCore::FloatPoint contentOffset = WebCore::ScrollableArea::scrollOffsetFromPosition(scrollPosition, toFloatSize(scrollOrigin));
Lines 2356-2368 static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm_sec3
2356
2362
2357
    [_scrollView _stopScrollingAndZoomingAnimations];
2363
    [_scrollView _stopScrollingAndZoomingAnimations];
2358
2364
2359
    if (!CGPointEqualToPoint(contentOffsetInScrollViewCoordinates, [_scrollView contentOffset]))
2365
    // It's possible that they are not equal, but in the same device pixel, so _scrollView won't change.
2360
        [_scrollView setContentOffset:contentOffsetInScrollViewCoordinates];
2366
    // We need to calculate the round to device pixel here.
2367
    if (!pointsEqualInRoundToDevicePixel(contentOffsetInScrollViewCoordinates, [_scrollView contentOffset], _page->deviceScaleFactor()))
2368
        [_scrollView setContentOffset:contentOffsetInScrollViewCoordinates animated:animated];
2361
    else {
2369
    else {
2362
        // If we haven't changed anything, there would not be any VisibleContentRect update sent to the content.
2370
        // If we haven't changed anything, there would not be any VisibleContentRect update sent to the content.
2363
        // The WebProcess would keep the invalid contentOffset as its scroll position.
2371
        // The WebProcess would keep the invalid contentOffset as its scroll position.
2364
        // To synchronize the WebProcess with what is on screen, we send the VisibleContentRect again.
2372
        // To synchronize the WebProcess with what is on screen, we send the VisibleContentRect again.
2365
        _page->resendLastVisibleContentRects();
2373
        _page->resendLastVisibleContentRects();
2374
        // If _scrollView won't change, we still need send animation stop info to web side.
2375
        if (animated) {
2376
            WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
2377
            if (coordinator)
2378
                coordinator->scrollingTreeRootNodeIsScrollAnimationInProgressDidChange(false);
2379
        }
2366
    }
2380
    }
2367
}
2381
}
2368
2382
Lines 2878-2883 static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm_sec4
2878
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
2892
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
2879
{
2893
{
2880
    [self _didFinishScrolling];
2894
    [self _didFinishScrolling];
2895
2896
    WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
2897
    if (coordinator)
2898
        coordinator->scrollingTreeRootNodeIsScrollAnimationInProgressDidChange(false);
2881
}
2899
}
2882
2900
2883
- (void)_scrollViewDidInterruptDecelerating:(UIScrollView *)scrollView
2901
- (void)_scrollViewDidInterruptDecelerating:(UIScrollView *)scrollView
- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h -1 / +1 lines
Lines 97-103 struct PrintInfo; a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h_sec1
97
97
98
- (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
98
- (RefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
99
99
100
- (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin;
100
- (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin animated:(BOOL)animated;
101
- (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance;
101
- (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance;
102
- (double)_initialScaleFactor;
102
- (double)_initialScaleFactor;
103
- (double)_contentZoomScale;
103
- (double)_contentZoomScale;
- a/Source/WebKit/UIProcess/PageClient.h +2 lines
Lines 181-186 public: a/Source/WebKit/UIProcess/PageClient.h_sec1
181
    // Tell the view to scroll to the given position, and whether this was a programmatic scroll.
181
    // Tell the view to scroll to the given position, and whether this was a programmatic scroll.
182
    virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) = 0;
182
    virtual void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) = 0;
183
183
184
    virtual void requestScrollWithAnimation(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) { }
185
184
    // Return the current scroll position (not necessarily the same as the WebCore scroll position, because of scaling, insets etc.)
186
    // Return the current scroll position (not necessarily the same as the WebCore scroll position, because of scaling, insets etc.)
185
    virtual WebCore::FloatPoint viewScrollPosition() = 0;
187
    virtual WebCore::FloatPoint viewScrollPosition() = 0;
186
188
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm -1 / +1 lines
Lines 225-231 void RemoteLayerTreeDrawingAreaProxy::commitLayerTree(const RemoteLayerTreeTrans a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm_sec1
225
    // Handle requested scroll position updates from the scrolling tree transaction after didCommitLayerTree()
225
    // Handle requested scroll position updates from the scrolling tree transaction after didCommitLayerTree()
226
    // has updated the view size based on the content size.
226
    // has updated the view size based on the content size.
227
    if (requestedScrollInfo.requestsScrollPositionUpdate)
227
    if (requestedScrollInfo.requestsScrollPositionUpdate)
228
        m_webPageProxy.requestScroll(requestedScrollInfo.requestedScrollPosition, layerTreeTransaction.scrollOrigin());
228
        m_webPageProxy.requestScroll(requestedScrollInfo.requestedScrollPosition, layerTreeTransaction.scrollOrigin(), requestedScrollInfo.requestWithAnimation);
229
#endif // ENABLE(ASYNC_SCROLLING)
229
#endif // ENABLE(ASYNC_SCROLLING)
230
230
231
    if (m_debugIndicatorLayerTreeHost) {
231
    if (m_debugIndicatorLayerTreeHost) {
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp -3 / +15 lines
Lines 208-214 void RemoteScrollingCoordinatorProxy::currentSnapPointIndicesDidChange(WebCore:: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec1
208
}
208
}
209
209
210
// This comes from the scrolling tree.
210
// This comes from the scrolling tree.
211
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
211
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction, bool instantScrollDidStopAnimation)
212
{
212
{
213
    // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
213
    // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
214
    // so don't send them here.
214
    // so don't send them here.
Lines 222-242 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec2
222
    m_webPageProxy.scrollingNodeScrollViewDidScroll();
222
    m_webPageProxy.scrollingNodeScrollViewDidScroll();
223
#endif
223
#endif
224
224
225
    if (m_scrollingTree->isHandlingProgrammaticScroll())
225
    if (m_scrollingTree->isHandlingProgrammaticScroll() && !instantScrollDidStopAnimation)
226
        return;
226
        return;
227
227
228
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync));
228
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync));
229
}
229
}
230
230
231
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll)
231
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll, bool withAnimation)
232
{
232
{
233
    if (scrolledNodeID == rootScrollingNodeID() && m_requestedScrollInfo) {
233
    if (scrolledNodeID == rootScrollingNodeID() && m_requestedScrollInfo) {
234
        m_requestedScrollInfo->requestsScrollPositionUpdate = true;
234
        m_requestedScrollInfo->requestsScrollPositionUpdate = true;
235
        m_requestedScrollInfo->requestIsProgrammaticScroll = representsProgrammaticScroll;
235
        m_requestedScrollInfo->requestIsProgrammaticScroll = representsProgrammaticScroll;
236
        m_requestedScrollInfo->requestWithAnimation = withAnimation;
236
        m_requestedScrollInfo->requestedScrollPosition = scrollPosition;
237
        m_requestedScrollInfo->requestedScrollPosition = scrollPosition;
237
    }
238
    }
238
}
239
}
239
240
241
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID scrolledNodeID, bool isScrollAnimationInProgress)
242
{
243
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::scrollAnimationInProgressChangedForNode(scrolledNodeID, isScrollAnimationInProgress));
244
}
245
246
void RemoteScrollingCoordinatorProxy::scrollingTreeRootNodeIsScrollAnimationInProgressDidChange(bool isScrollAnimationInProgress)
247
{
248
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::scrollAnimationInProgressChangedForNode(rootScrollingNodeID(), isScrollAnimationInProgress));    
249
}
250
251
240
String RemoteScrollingCoordinatorProxy::scrollingTreeAsText() const
252
String RemoteScrollingCoordinatorProxy::scrollingTreeAsText() const
241
{
253
{
242
    if (m_scrollingTree)
254
    if (m_scrollingTree)
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h -2 / +6 lines
Lines 56-63 public: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h_sec1
56
    virtual ~RemoteScrollingCoordinatorProxy();
56
    virtual ~RemoteScrollingCoordinatorProxy();
57
57
58
    // Inform the web process that the scroll position changed (called from the scrolling tree)
58
    // Inform the web process that the scroll position changed (called from the scrolling tree)
59
    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction);
59
    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction, bool instantScrollDidStopAnimation = false);
60
    void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll);
60
    void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll, bool withAnimation = false);
61
62
    void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool isScrollAnimationInProgress);
63
    void scrollingTreeRootNodeIsScrollAnimationInProgressDidChange(bool isScrollAnimationInProgress);
61
64
62
    WebCore::TrackingType eventTrackingTypeForPoint(const AtomString& eventName, WebCore::IntPoint) const;
65
    WebCore::TrackingType eventTrackingTypeForPoint(const AtomString& eventName, WebCore::IntPoint) const;
63
66
Lines 80-85 public: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h_sec2
80
    struct RequestedScrollInfo {
83
    struct RequestedScrollInfo {
81
        bool requestsScrollPositionUpdate { };
84
        bool requestsScrollPositionUpdate { };
82
        bool requestIsProgrammaticScroll { };
85
        bool requestIsProgrammaticScroll { };
86
        bool requestWithAnimation { };
83
        WebCore::FloatPoint requestedScrollPosition;
87
        WebCore::FloatPoint requestedScrollPosition;
84
    };
88
    };
85
    void commitScrollingTreeState(const RemoteScrollingCoordinatorTransaction&, RequestedScrollInfo&);
89
    void commitScrollingTreeState(const RemoteScrollingCoordinatorTransaction&, RequestedScrollInfo&);
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp -3 / +8 lines
Lines 104-115 void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingTreeScrollingNode& a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp_sec1
104
    if (is<ScrollingTreeFrameScrollingNode>(node))
104
    if (is<ScrollingTreeFrameScrollingNode>(node))
105
        layoutViewportOrigin = downcast<ScrollingTreeFrameScrollingNode>(node).layoutViewport().location();
105
        layoutViewportOrigin = downcast<ScrollingTreeFrameScrollingNode>(node).layoutViewport().location();
106
106
107
    m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(node.scrollingNodeID(), node.currentScrollPosition(), layoutViewportOrigin, scrollingLayerPositionAction);
107
    m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(node.scrollingNodeID(), node.currentScrollPosition(), layoutViewportOrigin, scrollingLayerPositionAction, node.needsStopCurrentScrollAnimation() && !node.requestScrollWithAnimation());
108
}
108
}
109
109
110
void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll)
110
void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll, bool withAnimation)
111
{
111
{
112
    m_scrollingCoordinatorProxy.scrollingTreeNodeRequestsScroll(nodeID, scrollPosition, representsProgrammaticScroll);
112
    m_scrollingCoordinatorProxy.scrollingTreeNodeRequestsScroll(nodeID, scrollPosition, representsProgrammaticScroll, withAnimation);
113
}
113
}
114
114
115
Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
115
Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
Lines 143-148 Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNod a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp_sec2
143
    return ScrollingTreeFixedNode::create(*this, nodeID);
143
    return ScrollingTreeFixedNode::create(*this, nodeID);
144
}
144
}
145
145
146
void RemoteScrollingTree::scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID nodeID, bool isScrollAnimationInProgress)
147
{
148
    m_scrollingCoordinatorProxy.scrollingTreeNodeIsScrollAnimationInProgressDidChange(nodeID, isScrollAnimationInProgress);
149
}
150
146
void RemoteScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
151
void RemoteScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
147
{
152
{
148
    m_scrollingCoordinatorProxy.currentSnapPointIndicesDidChange(nodeID, horizontal, vertical);
153
    m_scrollingCoordinatorProxy.currentSnapPointIndicesDidChange(nodeID, horizontal, vertical);
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h -1 / +3 lines
Lines 52-58 public: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h_sec1
52
    const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; }
52
    const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; }
53
53
54
    void scrollingTreeNodeDidScroll(WebCore::ScrollingTreeScrollingNode&, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override;
54
    void scrollingTreeNodeDidScroll(WebCore::ScrollingTreeScrollingNode&, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override;
55
    void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll) override;
55
    void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll, bool withAnimation = false) override;
56
57
    void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool isScrollAnimationInProgress) override;
56
58
57
    void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
59
    void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
58
60
- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h +1 lines
Lines 57-62 public: a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h_sec1
57
    void scrollDidEnd() const;
57
    void scrollDidEnd() const;
58
    void scrollViewWillStartPanGesture() const;
58
    void scrollViewWillStartPanGesture() const;
59
    void scrollViewDidScroll(const WebCore::FloatPoint& scrollOffset, bool inUserInteraction);
59
    void scrollViewDidScroll(const WebCore::FloatPoint& scrollOffset, bool inUserInteraction);
60
    void scrollViewDidEndScrollingAnimation();
60
61
61
    void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const;
62
    void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const;
62
    CALayer *scrollLayer() const { return m_scrollLayer.get(); }
63
    CALayer *scrollLayer() const { return m_scrollLayer.get(); }
- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm -4 / +39 lines
Lines 152-157 a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec1
152
    }
152
    }
153
}
153
}
154
154
155
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
156
{
157
    _scrollingTreeNodeDelegate->scrollViewDidEndScrollingAnimation();
158
}
159
155
#if ENABLE(POINTER_EVENTS)
160
#if ENABLE(POINTER_EVENTS)
156
- (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
161
- (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
157
{
162
{
Lines 300-314 void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const Scrol a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec2
300
305
301
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
306
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
302
        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
307
        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
303
        scrollingNode().scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType);
308
        if (scrollingStateNode.requestedScrollPositionWithAnimation())
309
            scrollingNode().setRequestScrollWithAnimation(true);
310
        // If the scroll positions are not same, there's a posibility that the scroll offset from web has been overriden.
311
        // In this case, it need to sync the scroll offset back to Web side.
312
        bool shouldSyncScrollPosition = scrollingStateNode.scrollPosition() != scrollingNode().currentScrollPosition();
313
        scrollingNode().scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType, ScrollPositionClamp::ToContentEdges, shouldSyncScrollPosition);
304
    }
314
    }
305
}
315
}
306
316
307
void ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers()
317
void ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers()
308
{
318
{
309
    BEGIN_BLOCK_OBJC_EXCEPTIONS
319
    bool animationInProgress = scrollingNode().scrollAnimationInProgress();
310
    [scrollView() setContentOffset:scrollingNode().currentScrollOffset()];
320
    bool needToStopAnimation = scrollingNode().needsStopCurrentScrollAnimation();
311
    END_BLOCK_OBJC_EXCEPTIONS
321
    if (needToStopAnimation && animationInProgress) {
322
        BEGIN_BLOCK_OBJC_EXCEPTIONS
323
        [scrollView() setContentOffset:scrollView().contentOffset animated:NO];
324
        END_BLOCK_OBJC_EXCEPTIONS
325
    }
326
327
    if (scrollingNode().requestScrollWithAnimation()) {
328
        BEGIN_BLOCK_OBJC_EXCEPTIONS
329
        [scrollView() setContentOffset:scrollingNode().currentScrollOffset() animated:YES];
330
        END_BLOCK_OBJC_EXCEPTIONS
331
332
        scrollingNode().setScrollAnimationInProgress(true);
333
    } else if (!animationInProgress || needToStopAnimation) {
334
        BEGIN_BLOCK_OBJC_EXCEPTIONS
335
        [scrollView() setContentOffset:scrollingNode().currentScrollOffset()];
336
        END_BLOCK_OBJC_EXCEPTIONS
337
    }
312
}
338
}
313
339
314
void ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart() const
340
void ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart() const
Lines 335-340 void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll(const FloatPoint a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec3
335
    scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition, { }, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
361
    scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition, { }, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
336
}
362
}
337
363
364
void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidEndScrollingAnimation()
365
{
366
    auto& node = scrollingNode();
367
    if (!(node.requestScrollWithAnimation() && node.scrollAnimationInProgress())) {
368
        scrollingTree().scrollingTreeNodeIsScrollAnimationInProgressDidChange(node.scrollingNodeID(), false);
369
        node.setScrollAnimationInProgress(false);
370
    }
371
}
372
338
void ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const
373
void ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const
339
{
374
{
340
    if (m_updatingFromStateNode)
375
    if (m_updatingFromStateNode)
- a/Source/WebKit/UIProcess/WebPageProxy.cpp -2 / +5 lines
Lines 1731-1739 void WebPageProxy::setViewNeedsDisplay(const Region& region) a/Source/WebKit/UIProcess/WebPageProxy.cpp_sec1
1731
    pageClient().setViewNeedsDisplay(region);
1731
    pageClient().setViewNeedsDisplay(region);
1732
}
1732
}
1733
1733
1734
void WebPageProxy::requestScroll(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin)
1734
void WebPageProxy::requestScroll(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin, const bool withAnimation)
1735
{
1735
{
1736
    pageClient().requestScroll(scrollPosition, scrollOrigin);
1736
    if (withAnimation)
1737
        pageClient().requestScrollWithAnimation(scrollPosition, scrollOrigin);
1738
    else
1739
        pageClient().requestScroll(scrollPosition, scrollOrigin);
1737
}
1740
}
1738
1741
1739
WebCore::FloatPoint WebPageProxy::viewScrollPosition() const
1742
WebCore::FloatPoint WebPageProxy::viewScrollPosition() const
- a/Source/WebKit/UIProcess/WebPageProxy.h -1 / +1 lines
Lines 612-618 public: a/Source/WebKit/UIProcess/WebPageProxy.h_sec1
612
    PageClient& pageClient() const;
612
    PageClient& pageClient() const;
613
613
614
    void setViewNeedsDisplay(const WebCore::Region&);
614
    void setViewNeedsDisplay(const WebCore::Region&);
615
    void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin);
615
    void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool withAnimation = false);
616
    
616
    
617
    WebCore::FloatPoint viewScrollPosition() const;
617
    WebCore::FloatPoint viewScrollPosition() const;
618
618
- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h +1 lines
Lines 57-62 private: a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h_sec1
57
    std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override;
57
    std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override;
58
    void setViewNeedsDisplay(const WebCore::Region&) override;
58
    void setViewNeedsDisplay(const WebCore::Region&) override;
59
    void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) override;
59
    void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) override;
60
    void requestScrollWithAnimation(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) override;
60
    WebCore::FloatPoint viewScrollPosition() override;
61
    WebCore::FloatPoint viewScrollPosition() override;
61
    WebCore::IntSize viewSize() override;
62
    WebCore::IntSize viewSize() override;
62
    bool isViewWindowActive() override;
63
    bool isViewWindowActive() override;
- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm -1 / +6 lines
Lines 95-101 void PageClientImpl::setViewNeedsDisplay(const Region&) a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm_sec1
95
95
96
void PageClientImpl::requestScroll(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin)
96
void PageClientImpl::requestScroll(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin)
97
{
97
{
98
    [m_webView _scrollToContentScrollPosition:scrollPosition scrollOrigin:scrollOrigin];
98
    [m_webView _scrollToContentScrollPosition:scrollPosition scrollOrigin:scrollOrigin animated:NO];
99
}
100
101
void PageClientImpl::requestScrollWithAnimation(const FloatPoint& scrollPosition, const IntPoint& scrollOrigin)
102
{
103
    [m_webView _scrollToContentScrollPosition:scrollPosition scrollOrigin:scrollOrigin animated:YES];
99
}
104
}
100
105
101
WebCore::FloatPoint PageClientImpl::viewScrollPosition()
106
WebCore::FloatPoint PageClientImpl::viewScrollPosition()
- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h +2 lines
Lines 73-78 private: a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h_sec1
73
    void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool syncLayerPosition);
73
    void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool syncLayerPosition);
74
    void currentSnapPointIndicesChangedForNode(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical);
74
    void currentSnapPointIndicesChangedForNode(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical);
75
75
76
    void scrollAnimationInProgressChangedForNode(WebCore::ScrollingNodeID, bool isScrollAnimationInProgress);
77
76
    WebPage* m_webPage;
78
    WebPage* m_webPage;
77
};
79
};
78
80
- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in +1 lines
Lines 25-30 a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in_sec1
25
messages -> RemoteScrollingCoordinator {
25
messages -> RemoteScrollingCoordinator {
26
    ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition, bool syncLayerPosition);
26
    ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition, bool syncLayerPosition);
27
    CurrentSnapPointIndicesChangedForNode(uint64_t nodeID, unsigned horizontal, unsigned vertical);
27
    CurrentSnapPointIndicesChangedForNode(uint64_t nodeID, unsigned horizontal, unsigned vertical);
28
    scrollAnimationInProgressChangedForNode(uint64_t nodeID, bool isScrollAnimationInProgress);
28
}
29
}
29
30
30
#endif // ENABLE(ASYNC_SCROLLING)
31
#endif // ENABLE(ASYNC_SCROLLING)
- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm +5 lines
Lines 104-109 void RemoteScrollingCoordinator::currentSnapPointIndicesChangedForNode(Scrolling a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm_sec1
104
    setActiveScrollSnapIndices(nodeID, horizontal, vertical);
104
    setActiveScrollSnapIndices(nodeID, horizontal, vertical);
105
}
105
}
106
106
107
void RemoteScrollingCoordinator::scrollAnimationInProgressChangedForNode(WebCore::ScrollingNodeID nodeID, bool isScrollAnimationInProgress)
108
{
109
    setScrollAnimationInProgress(nodeID, isScrollAnimationInProgress);
110
}
111
107
} // namespace WebKit
112
} // namespace WebKit
108
113
109
#endif // ENABLE(ASYNC_SCROLLING)
114
#endif // ENABLE(ASYNC_SCROLLING)
- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h +1 lines
Lines 186-191 a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h_sec1
186
#define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
186
#define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
187
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
187
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
188
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
188
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
189
#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey @"WebKitCSSOMViewSmoothScrollingEnabled"
189
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
190
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
190
#define WebKitRemotePlaybackEnabledPreferenceKey @"WebKitRemotePlaybackEnabled"
191
#define WebKitRemotePlaybackEnabledPreferenceKey @"WebKitRemotePlaybackEnabled"
191
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
192
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm +11 lines
Lines 658-663 public: a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec1
658
#endif
658
#endif
659
659
660
        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
660
        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
661
        @NO, WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey,
661
        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
662
        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
662
        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
663
        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
663
#if ENABLE(MEDIA_STREAM)
664
#if ENABLE(MEDIA_STREAM)
Lines 3166-3171 static NSString *classIBCreatorID = nil; a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec2
3166
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3167
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3167
}
3168
}
3168
3169
3170
- (BOOL)CSSOMViewSmoothScrollingEnabled
3171
{
3172
    return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3173
}
3174
3175
- (void)setCSSOMViewSmoothScrollingEnabled:(BOOL)flag
3176
{
3177
    [self _setBoolValue:flag forKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3178
}
3179
3169
- (BOOL)webAnimationsEnabled
3180
- (BOOL)webAnimationsEnabled
3170
{
3181
{
3171
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
3182
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h +1 lines
Lines 626-631 extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h_sec1
626
626
627
@property (nonatomic) BOOL visualViewportAPIEnabled;
627
@property (nonatomic) BOOL visualViewportAPIEnabled;
628
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
628
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
629
@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
629
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
630
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
630
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
631
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
631
@property (nonatomic) BOOL javaScriptMarkupEnabled;
632
@property (nonatomic) BOOL javaScriptMarkupEnabled;
- a/Source/WebKitLegacy/mac/WebView/WebView.mm +1 lines
Lines 2992-2997 static bool needsSelfRetainWhileLoadingQuirk() a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec1
2992
    settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
2992
    settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
2993
    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
2993
    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
2994
    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
2994
    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
2995
    settings.setCSSOMViewSmoothScrollingEnabled([preferences CSSOMViewSmoothScrollingEnabled]);
2995
    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
2996
    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
2996
2997
2997
    switch ([preferences storageBlockingPolicy]) {
2998
    switch ([preferences storageBlockingPolicy]) {
- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl +2 lines
Lines 223-228 interface IWebPreferencesPrivate6 : IWebPreferencesPrivate5 a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl_sec1
223
    HRESULT setVisualViewportAPIEnabled([in] BOOL enabled);
223
    HRESULT setVisualViewportAPIEnabled([in] BOOL enabled);
224
    HRESULT CSSOMViewScrollingAPIEnabled([out, retval] BOOL*);
224
    HRESULT CSSOMViewScrollingAPIEnabled([out, retval] BOOL*);
225
    HRESULT setCSSOMViewScrollingAPIEnabled([in] BOOL enabled);
225
    HRESULT setCSSOMViewScrollingAPIEnabled([in] BOOL enabled);
226
    HRESULT CSSOMViewSmoothScrollingEnabled([out, retval] BOOL*);
227
    HRESULT setCSSOMViewSmoothScrollingEnabled([in] BOOL enabled);
226
    HRESULT fetchAPIKeepAliveEnabled([out, retval] BOOL* enabled);
228
    HRESULT fetchAPIKeepAliveEnabled([out, retval] BOOL* enabled);
227
    HRESULT setFetchAPIKeepAliveEnabled([in] BOOL enabled);
229
    HRESULT setFetchAPIKeepAliveEnabled([in] BOOL enabled);
228
    HRESULT spatialNavigationEnabled([out, retval] BOOL *enabled);
230
    HRESULT spatialNavigationEnabled([out, retval] BOOL *enabled);
- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h +1 lines
Lines 207-212 a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h_sec1
207
#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
207
#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
208
208
209
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
209
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
210
#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey "WebKitCSSOMViewSmoothScrollingEnabled"
210
211
211
#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
212
#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
212
213
- a/Source/WebKitLegacy/win/WebPreferences.cpp +16 lines
Lines 337-342 void WebPreferences::initializeDefaultSettings() a/Source/WebKitLegacy/win/WebPreferences.cpp_sec1
337
337
338
    CFDictionaryAddValue(defaults, CFSTR(WebKitResizeObserverEnabledPreferenceKey), kCFBooleanFalse);
338
    CFDictionaryAddValue(defaults, CFSTR(WebKitResizeObserverEnabledPreferenceKey), kCFBooleanFalse);
339
339
340
    CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey), kCFBooleanFalse);
341
340
    CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
342
    CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
341
343
342
    CFDictionaryAddValue(defaults, CFSTR(WebKitRequestIdleCallbackEnabledPreferenceKey), kCFBooleanFalse);
344
    CFDictionaryAddValue(defaults, CFSTR(WebKitRequestIdleCallbackEnabledPreferenceKey), kCFBooleanFalse);
Lines 2280-2285 HRESULT WebPreferences::setCoreMathMLEnabled(BOOL enabled) a/Source/WebKitLegacy/win/WebPreferences.cpp_sec2
2280
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2282
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2281
    return S_OK;
2283
    return S_OK;
2282
}
2284
}
2285
    
2286
HRESULT WebPreferences::CSSOMViewSmoothScrollingEnabled(_Out_ BOOL* enabled)
2287
{
2288
    if (!enabled)
2289
        return E_POINTER;
2290
    *enabled = boolValueForKey(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey);
2291
    return S_OK;
2292
}
2293
2294
HRESULT WebPreferences::setCSSOMViewSmoothScrollingEnabled(BOOL enabled)
2295
{
2296
    setBoolValue(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey, enabled);
2297
    return S_OK;
2298
}
2283
2299
2284
HRESULT WebPreferences::requestIdleCallbackEnabled(_Out_ BOOL* enabled)
2300
HRESULT WebPreferences::requestIdleCallbackEnabled(_Out_ BOOL* enabled)
2285
{
2301
{
- a/Source/WebKitLegacy/win/WebPreferences.h +2 lines
Lines 271-276 public: a/Source/WebKitLegacy/win/WebPreferences.h_sec1
271
    virtual HRESULT STDMETHODCALLTYPE setVisualViewportAPIEnabled(BOOL);
271
    virtual HRESULT STDMETHODCALLTYPE setVisualViewportAPIEnabled(BOOL);
272
    virtual HRESULT STDMETHODCALLTYPE CSSOMViewScrollingAPIEnabled(_Out_ BOOL*);
272
    virtual HRESULT STDMETHODCALLTYPE CSSOMViewScrollingAPIEnabled(_Out_ BOOL*);
273
    virtual HRESULT STDMETHODCALLTYPE setCSSOMViewScrollingAPIEnabled(BOOL);
273
    virtual HRESULT STDMETHODCALLTYPE setCSSOMViewScrollingAPIEnabled(BOOL);
274
    virtual HRESULT STDMETHODCALLTYPE CSSOMViewSmoothScrollingEnabled(_Out_ BOOL*);
275
    virtual HRESULT STDMETHODCALLTYPE setCSSOMViewSmoothScrollingEnabled(BOOL);
274
    virtual HRESULT STDMETHODCALLTYPE fetchAPIKeepAliveEnabled(_Out_ BOOL*);
276
    virtual HRESULT STDMETHODCALLTYPE fetchAPIKeepAliveEnabled(_Out_ BOOL*);
275
    virtual HRESULT STDMETHODCALLTYPE setFetchAPIKeepAliveEnabled(BOOL);
277
    virtual HRESULT STDMETHODCALLTYPE setFetchAPIKeepAliveEnabled(BOOL);
276
    virtual HRESULT STDMETHODCALLTYPE spatialNavigationEnabled(_Out_ BOOL*);
278
    virtual HRESULT STDMETHODCALLTYPE spatialNavigationEnabled(_Out_ BOOL*);
- a/Source/WebKitLegacy/win/WebView.cpp +5 lines
Lines 5298-5303 HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) a/Source/WebKitLegacy/win/WebView.cpp_sec1
5298
        return hr;
5298
        return hr;
5299
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5299
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5300
5300
5301
    hr = prefsPrivate->CSSOMViewSmoothScrollingEnabled(&enabled);
5302
    if (FAILED(hr))
5303
        return hr;
5304
    settings.setCSSOMViewSmoothScrollingEnabled(!!enabled);
5305
5301
    hr = preferences->privateBrowsingEnabled(&enabled);
5306
    hr = preferences->privateBrowsingEnabled(&enabled);
5302
    if (FAILED(hr))
5307
    if (FAILED(hr))
5303
        return hr;
5308
        return hr;
- a/Tools/ChangeLog +13 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2018-11-06  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * DumpRenderTree/TestOptions.cpp:
9
        (TestOptions::TestOptions): Parse CSSOMViewSmoothScrollingEnabled.
10
        * DumpRenderTree/TestOptions.h: Add CSSOMViewSmoothScrollingEnabled, disabled by default.
11
        * DumpRenderTree/mac/DumpRenderTree.mm:
12
        (setWebPreferencesForTestOptions): Set CSSOMViewSmoothScrollingEnabled from the test options.
13
1
2019-11-25  Kent Tamura  <tkent@chromium.org>
14
2019-11-25  Kent Tamura  <tkent@chromium.org>
2
15
3
        Remove tkent@ from watchlist
16
        Remove tkent@ from watchlist
- a/Tools/DumpRenderTree/TestOptions.cpp +2 lines
Lines 121-126 TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu a/Tools/DumpRenderTree/TestOptions.cpp_sec1
121
            adClickAttributionEnabled = parseBooleanTestHeaderValue(value);
121
            adClickAttributionEnabled = parseBooleanTestHeaderValue(value);
122
        else if (key == "experimental:ResizeObserverEnabled")
122
        else if (key == "experimental:ResizeObserverEnabled")
123
            enableResizeObserver = parseBooleanTestHeaderValue(value);
123
            enableResizeObserver = parseBooleanTestHeaderValue(value);
124
        else if (key == "experimental:CSSOMViewSmoothScrollingEnabled")
125
            enableCSSOMViewSmoothScrolling = parseBooleanTestHeaderValue(value);
124
        else if (key == "experimental:CoreMathMLEnabled")
126
        else if (key == "experimental:CoreMathMLEnabled")
125
            enableCoreMathML = parseBooleanTestHeaderValue(value);
127
            enableCoreMathML = parseBooleanTestHeaderValue(value);
126
        else if (key == "experimental:RequestIdleCallbackEnabled")
128
        else if (key == "experimental:RequestIdleCallbackEnabled")
- a/Tools/DumpRenderTree/TestOptions.h +1 lines
Lines 50-55 struct TestOptions { a/Tools/DumpRenderTree/TestOptions.h_sec1
50
    bool enableCSSLogical { false };
50
    bool enableCSSLogical { false };
51
    bool adClickAttributionEnabled { false };
51
    bool adClickAttributionEnabled { false };
52
    bool enableResizeObserver { false };
52
    bool enableResizeObserver { false };
53
    bool enableCSSOMViewSmoothScrolling { false };
53
    bool enableCoreMathML { false };
54
    bool enableCoreMathML { false };
54
    bool enableRequestIdleCallback { false };
55
    bool enableRequestIdleCallback { false };
55
    bool enableAsyncClipboardAPI { false };
56
    bool enableAsyncClipboardAPI { false };
- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +1 lines
Lines 1027-1032 static void setWebPreferencesForTestOptions(const TestOptions& options) a/Tools/DumpRenderTree/mac/DumpRenderTree.mm_sec1
1027
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1027
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1028
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1028
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1029
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1029
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1030
    preferences.CSSOMViewSmoothScrollingEnabled = options.enableCSSOMViewSmoothScrolling;
1030
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1031
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1031
    preferences.requestIdleCallbackEnabled = options.enableRequestIdleCallback;
1032
    preferences.requestIdleCallbackEnabled = options.enableRequestIdleCallback;
1032
    preferences.asyncClipboardAPIEnabled = options.enableAsyncClipboardAPI;
1033
    preferences.asyncClipboardAPIEnabled = options.enableAsyncClipboardAPI;
- a/LayoutTests/ChangeLog +34 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2018-11-07  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
        The scroll animation on iOS platform is using native scroll animation which need enable
6
        AsyncOverflowScrollingEnabled and AsyncFrameScrollingEnabled. In order to test properly,
7
        copy scroll-behavior test to fast/scrolling/ios/
8
9
        Reviewed by NOBODY (OOPS!).
10
11
        * fast/scrolling/ios/resources/scroll-behavior.js: Added.
12
        (observeScrolling):
13
        (waitForScrollEnd):
14
        (scrollNode):
15
        (scrollWindow):
16
        * fast/scrolling/ios/scroll-behavior-default-css-expected.txt: Added.
17
        * fast/scrolling/ios/scroll-behavior-default-css.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html.
18
        * fast/scrolling/ios/scroll-behavior-element-expected.txt: Added.
19
        * fast/scrolling/ios/scroll-behavior-element.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html.
20
        * fast/scrolling/ios/scroll-behavior-main-frame-root-expected.txt: Added.
21
        * fast/scrolling/ios/scroll-behavior-main-frame-root.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html.
22
        * fast/scrolling/ios/scroll-behavior-main-frame-window-expected.txt: Added.
23
        * fast/scrolling/ios/scroll-behavior-main-frame-window.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html.
24
        * fast/scrolling/ios/scroll-behavior-scrollintoview-nested-expected.txt: Added.
25
        * fast/scrolling/ios/scroll-behavior-scrollintoview-nested.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html.
26
        * fast/scrolling/ios/scroll-behavior-smooth-positions-expected.txt: Added.
27
        * fast/scrolling/ios/scroll-behavior-smooth-positions.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html.
28
        * fast/scrolling/ios/scroll-behavior-subframe-root-expected.txt: Added.
29
        * fast/scrolling/ios/scroll-behavior-subframe-root.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html.
30
        * fast/scrolling/ios/scroll-behavior-subframe-window-expected.txt: Added.
31
        * fast/scrolling/ios/scroll-behavior-subframe-window.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html.
32
        * platform/mac-wk1/TestExpectations: Skip these tests on WK1 as they don't work for now and
33
        are slow anyway.
34
1
2019-11-26  Alejandro G. Castro  <alex@igalia.com>
35
2019-11-26  Alejandro G. Castro  <alex@igalia.com>
2
36
3
        [GTK][WPE] New tests crashing after added in the r251377
37
        [GTK][WPE] New tests crashing after added in the r251377
- a/LayoutTests/imported/w3c/ChangeLog -3 / +27 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2018-11-06  Frederic Wang  <fwang@igalia.com>
2
3
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
4
        https://bugs.webkit.org/show_bug.cgi?id=188043
5
6
        Reviewed by NOBODY (OOPS!).
7
        Enable CSSOMViewSmoothScrollingEnabled on scroll behavior tests and update expectations.
8
9
        * web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt:
10
        * web-platform-tests/css/cssom-view/scroll-behavior-default-css.html:
11
        * web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt:
12
        * web-platform-tests/css/cssom-view/scroll-behavior-element.html:
13
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt:
14
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html:
15
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt:
16
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html:
17
        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt:
18
        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html:
19
        * web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html:
20
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt:
21
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html:
22
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt:
23
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html:
24
1
2019-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
25
2019-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
2
26
3
        [css-grid] Avoid serializing [] in grid-template* specified values
27
        [css-grid] Avoid serializing [] in grid-template* specified values
Lines 4310-4316 a/LayoutTests/imported/w3c/ChangeLog_sec2
4310
        (@charset "windows-1250";):
4334
        (@charset "windows-1250";):
4311
        * web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers: Added.
4335
        * web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers: Added.
4312
        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css: Added.
4336
        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css: Added.
4313
        (#È):
4337
        (#�):
4314
        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers: Added.
4338
        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers: Added.
4315
        * web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css: Added.
4339
        * web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css: Added.
4316
        (@charset "windows-1253";):
4340
        (@charset "windows-1253";):
Lines 4318-4326 a/LayoutTests/imported/w3c/ChangeLog_sec3
4318
        * web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css: Added.
4342
        * web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css: Added.
4319
        (#foo):
4343
        (#foo):
4320
        * web-platform-tests/css/css-syntax/charset/support/no-decl.css: Added.
4344
        * web-platform-tests/css/css-syntax/charset/support/no-decl.css: Added.
4321
        (#È):
4345
        (#�):
4322
        * web-platform-tests/css/css-syntax/charset/support/utf8-bom.css: Added.
4346
        * web-platform-tests/css/css-syntax/charset/support/utf8-bom.css: Added.
4323
        (#È):
4347
        (#�):
4324
        * web-platform-tests/css/css-syntax/charset/support/w3c-import.log: Added.
4348
        * web-platform-tests/css/css-syntax/charset/support/w3c-import.log: Added.
4325
        * web-platform-tests/css/css-syntax/charset/w3c-import.log: Added.
4349
        * web-platform-tests/css/css-syntax/charset/w3c-import.log: Added.
4326
        * web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt: Added.
4350
        * web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt: Added.
- a/LayoutTests/fast/scrolling/ios/resources/scroll-behavior.js +87 lines
Line 0 a/LayoutTests/fast/scrolling/ios/resources/scroll-behavior.js_sec1
1
function observeScrolling(elements, callback) {
2
  if (!Array.isArray(elements))
3
      elements = [elements];
4
  var lastChangedFrame = 0;
5
  var lastLeft = new Map();
6
  var lastTop = new Map();
7
  elements.forEach((element) => {
8
    lastLeft.set(element, element.scrollLeft);
9
    lastTop.set(element, element.scrollTop);
10
  });
11
  function tick(frames) {
12
    // We requestAnimationFrame either for 500 frames or until 20 frames with
13
    // no change have been observed.
14
    if (frames >= 500 || frames - lastChangedFrame > 20) {
15
      callback(true);
16
    } else {
17
      var scrollHappened = elements.some((element) => {
18
        return element.scrollLeft != lastLeft.get(element) || element.scrollTop != lastTop.get(element);
19
      });
20
      if (scrollHappened) {
21
        lastChangedFrame = frames;
22
        elements.forEach((element) => {
23
          lastLeft.set(element, element.scrollLeft);
24
          lastTop.set(element, element.scrollTop);
25
        });
26
        callback(false);
27
      }
28
      requestAnimationFrame(tick.bind(null, frames + 1));
29
    }
30
  }
31
  tick(0);
32
}
33
34
function waitForScrollEnd(elements) {
35
  return new Promise((resolve) => {
36
    observeScrolling(elements, (done) => {
37
      if (done)
38
        resolve();
39
    });
40
  });
41
}
42
43
function resetScroll(scrollingElement) {
44
  // Try various methods to ensure the element position is reset immediately.
45
  scrollingElement.scrollLeft = 0;
46
  scrollingElement.scrollTop = 0;
47
  scrollingElement.scroll({left: 0, top: 0, behavior: "instant"});
48
}
49
50
function resetScrollForWindow(scrollingWindow) {
51
  // Try various methods to ensure the element position is reset immediately.
52
  scrollingWindow.document.scrollingElement.scrollLeft = 0;
53
  scrollingWindow.document.scrollingElement.scrollTop = 0;
54
  scrollingWindow.scroll({left: 0, top: 0, behavior: "instant"});
55
}
56
57
function setScrollBehavior(styledElement, className) {
58
  styledElement.classList.remove("autoBehavior", "smoothBehavior");
59
  styledElement.classList.add(className);
60
}
61
62
function scrollNode(scrollingElement, scrollFunction, behavior, elementToRevealLeft, elementToRevealTop) {
63
  var args = {};
64
  if (behavior)
65
    args.behavior = behavior;
66
  switch (scrollFunction) {
67
    case "scrollIntoView":
68
      args.inline = "start";
69
      args.block = "start";
70
      elementToReveal.scrollIntoView(args);
71
      break;
72
    default:
73
      args.left = elementToRevealLeft;
74
      args.top = elementToRevealTop;
75
      scrollingElement[scrollFunction](args);
76
      break;
77
  }
78
}
79
80
function scrollWindow(scrollingWindow, scrollFunction, behavior, elementToRevealLeft, elementToRevealTop) {
81
  var args = {};
82
  if (behavior)
83
    args.behavior = behavior;
84
  args.left = elementToRevealLeft;
85
  args.top = elementToRevealTop;
86
  scrollingWindow[scrollFunction](args);
87
}
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-default-css-expected.txt +4 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-default-css-expected.txt_sec1
1
2
PASS Instant scrolling of an element with default scroll-behavior 
3
PASS Smooth scrolling of an element with default scroll-behavior 
4
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-default-css.html +52 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-default-css.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing default value of scroll-behavior</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<style>
11
  .scrollable {
12
    overflow: auto;
13
    width: 400px;
14
    height: 200px;
15
  }
16
</style>
17
<div id="log">
18
</div>
19
<div id="overflowNode" class="scrollable">
20
  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
21
    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
22
  </div>
23
</div>
24
<script>
25
  var scrollingElement = overflowNode;
26
  var elementToRevealLeft = 500;
27
  var elementToRevealTop = 250;
28
  var scrollFunction = "scroll";
29
30
  promise_test(() => {
31
    resetScroll(scrollingElement);
32
    assert_equals(scrollingElement.scrollLeft, 0);
33
    assert_equals(scrollingElement.scrollTop, 0);
34
    scrollNode(scrollingElement, "scroll", "instant", elementToRevealLeft, elementToRevealTop);
35
    assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
36
    assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
37
    return new Promise((resolve) => { resolve(); });
38
  }, "Instant scrolling of an element with default scroll-behavior");
39
40
  promise_test(() => {
41
    resetScroll(scrollingElement);
42
    assert_equals(scrollingElement.scrollLeft, 0);
43
    assert_equals(scrollingElement.scrollTop, 0);
44
    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
45
    assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
46
    assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
47
    return waitForScrollEnd(scrollingElement).then(() => {
48
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
49
      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
50
    });
51
  }, "Smooth scrolling of an element with default scroll-behavior");
52
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-element-expected.txt +36 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-element-expected.txt_sec1
1
2
PASS Element with auto scroll-behavior ; scroll() with default behavior 
3
PASS Element with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Element with auto scroll-behavior ; scroll() with instant behavior 
5
PASS Element with auto scroll-behavior ; scroll() with smooth behavior 
6
PASS Element with smooth scroll-behavior ; scroll() with default behavior 
7
PASS Element with smooth scroll-behavior ; scroll() with auto behavior 
8
PASS Element with smooth scroll-behavior ; scroll() with instant behavior 
9
PASS Element with smooth scroll-behavior ; scroll() with smooth behavior 
10
PASS Element with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Element with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Element with auto scroll-behavior ; scrollTo() with instant behavior 
13
PASS Element with auto scroll-behavior ; scrollTo() with smooth behavior 
14
PASS Element with smooth scroll-behavior ; scrollTo() with default behavior 
15
PASS Element with smooth scroll-behavior ; scrollTo() with auto behavior 
16
PASS Element with smooth scroll-behavior ; scrollTo() with instant behavior 
17
PASS Element with smooth scroll-behavior ; scrollTo() with smooth behavior 
18
PASS Element with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Element with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Element with auto scroll-behavior ; scrollBy() with instant behavior 
21
PASS Element with auto scroll-behavior ; scrollBy() with smooth behavior 
22
PASS Element with smooth scroll-behavior ; scrollBy() with default behavior 
23
PASS Element with smooth scroll-behavior ; scrollBy() with auto behavior 
24
PASS Element with smooth scroll-behavior ; scrollBy() with instant behavior 
25
PASS Element with smooth scroll-behavior ; scrollBy() with smooth behavior 
26
PASS Element with auto scroll-behavior ; scrollIntoView() with default behavior 
27
PASS Element with auto scroll-behavior ; scrollIntoView() with auto behavior 
28
PASS Element with auto scroll-behavior ; scrollIntoView() with instant behavior 
29
PASS Element with auto scroll-behavior ; scrollIntoView() with smooth behavior 
30
PASS Element with smooth scroll-behavior ; scrollIntoView() with default behavior 
31
PASS Element with smooth scroll-behavior ; scrollIntoView() with auto behavior 
32
PASS Element with smooth scroll-behavior ; scrollIntoView() with instant behavior 
33
PASS Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
34
PASS Aborting an ongoing smooth scrolling on an element with another smooth scrolling 
35
PASS Aborting an ongoing smooth scrolling on an element with an instant scrolling 
36
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-element.html +163 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-element.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on an element</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<style>
11
  .scrollable {
12
    overflow: auto;
13
    width: 400px;
14
    height: 200px;
15
  }
16
  .autoBehavior {
17
    scroll-behavior: auto;
18
  }
19
  .smoothBehavior {
20
    scroll-behavior: smooth;
21
  }
22
</style>
23
<div id="log">
24
</div>
25
<div id="overflowNode" class="scrollable">
26
  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
27
    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
28
  </div>
29
</div>
30
<script>
31
  var scrollingElement = overflowNode;
32
  var styledElement = overflowNode;
33
  var elementToRevealLeft = 500;
34
  var elementToRevealTop = 250;
35
36
  ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
37
    promise_test(() => {
38
      resetScroll(scrollingElement);
39
      setScrollBehavior(styledElement, "autoBehavior");
40
      assert_equals(scrollingElement.scrollLeft, 0);
41
      assert_equals(scrollingElement.scrollTop, 0);
42
      scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
43
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
44
      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
45
      return new Promise((resolve) => { resolve(); });
46
    }, `Element with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
47
48
    promise_test(() => {
49
      resetScroll(scrollingElement);
50
      setScrollBehavior(styledElement, "autoBehavior");
51
      assert_equals(scrollingElement.scrollLeft, 0);
52
      assert_equals(scrollingElement.scrollTop, 0);
53
      scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
54
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
55
      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
56
      return new Promise((resolve) => { resolve(); });
57
    }, `Element with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
58
59
    promise_test(() => {
60
      resetScroll(scrollingElement);
61
      setScrollBehavior(styledElement, "autoBehavior");
62
      assert_equals(scrollingElement.scrollLeft, 0);
63
      assert_equals(scrollingElement.scrollTop, 0);
64
      scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
65
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
66
      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
67
      return new Promise((resolve) => { resolve(); });
68
    }, `Element with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
69
70
    promise_test(() => {
71
      resetScroll(scrollingElement);
72
      setScrollBehavior(styledElement, "autoBehavior");
73
      assert_equals(scrollingElement.scrollLeft, 0);
74
      assert_equals(scrollingElement.scrollTop, 0);
75
      scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
76
      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
77
      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
78
      return waitForScrollEnd(scrollingElement).then(() => {
79
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
80
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
81
      });
82
    }, `Element with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
83
84
    promise_test(() => {
85
      resetScroll(scrollingElement);
86
      setScrollBehavior(styledElement, "smoothBehavior");
87
      assert_equals(scrollingElement.scrollLeft, 0);
88
      assert_equals(scrollingElement.scrollTop, 0);
89
      scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
90
      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
91
      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
92
      return waitForScrollEnd(scrollingElement).then(() => {
93
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
94
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
95
      });
96
    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
97
98
    promise_test(() => {
99
      resetScroll(scrollingElement);
100
      setScrollBehavior(styledElement, "smoothBehavior");
101
      assert_equals(scrollingElement.scrollLeft, 0);
102
      assert_equals(scrollingElement.scrollTop, 0);
103
      scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
104
      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
105
      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
106
      return waitForScrollEnd(scrollingElement).then(() => {
107
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
108
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
109
      });
110
    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
111
112
    promise_test(() => {
113
      resetScroll(scrollingElement);
114
      setScrollBehavior(styledElement, "smoothBehavior");
115
      assert_equals(scrollingElement.scrollLeft, 0);
116
      assert_equals(scrollingElement.scrollTop, 0);
117
      scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
118
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
119
      assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
120
      return new Promise((resolve) => { resolve(); });
121
    }, `Element with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
122
123
    promise_test(() => {
124
      resetScroll(scrollingElement);
125
      setScrollBehavior(styledElement, "smoothBehavior");
126
      assert_equals(scrollingElement.scrollLeft, 0);
127
      assert_equals(scrollingElement.scrollTop, 0);
128
      scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
129
      assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
130
      assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
131
      return waitForScrollEnd(scrollingElement).then(() => {
132
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
133
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
134
      });
135
   }, `Element with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
136
  });
137
138
  promise_test(() => {
139
    resetScroll(scrollingElement);
140
    setScrollBehavior(styledElement, "smoothBehavior");
141
    assert_equals(scrollingElement.scrollLeft, 0);
142
    assert_equals(scrollingElement.scrollTop, 0);
143
    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
144
    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
145
    return waitForScrollEnd(scrollingElement).then(() => {
146
      assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
147
      assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
148
    });
149
  }, "Aborting an ongoing smooth scrolling on an element with another smooth scrolling");
150
151
  promise_test(() => {
152
    resetScroll(scrollingElement);
153
    setScrollBehavior(styledElement, "smoothBehavior");
154
    assert_equals(scrollingElement.scrollLeft, 0);
155
    assert_equals(scrollingElement.scrollTop, 0);
156
    scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
157
    scrollNode(scrollingElement, "scroll", "instant", 0, 0);
158
    return waitForScrollEnd(scrollingElement).then(() => {
159
      assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
160
      assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
161
    });
162
  }, "Aborting an ongoing smooth scrolling on an element with an instant scrolling");
163
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-root-expected.txt +37 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-root-expected.txt_sec1
1
2
PASS Page loaded 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Main frame with auto scroll-behavior ; scrollIntoView() with default behavior 
28
PASS Main frame with auto scroll-behavior ; scrollIntoView() with auto behavior 
29
PASS Main frame with auto scroll-behavior ; scrollIntoView() with instant behavior 
30
PASS Main frame with auto scroll-behavior ; scrollIntoView() with smooth behavior 
31
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with default behavior 
32
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with auto behavior 
33
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with instant behavior 
34
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
35
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
36
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
37
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-root.html +169 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-root.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of the main frame</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<style>
11
  body {
12
    margin: 0;
13
  }
14
  .autoBehavior {
15
    scroll-behavior: auto;
16
  }
17
  .smoothBehavior {
18
    scroll-behavior: smooth;
19
  }
20
</style>
21
<div id="log">
22
</div>
23
<div id="pageContent" style="position: absolute; left: 0; top: 0;">
24
  <div id="elementToReveal" style="position: absolute; display: inline-block; width: 10px; height: 15px; background: black;"></div>
25
</div>
26
<script>
27
  var pageLoaded = async_test("Page loaded");
28
  var scrollingElement, styledElement, elementToRevealLeft, elementToRevealTop;
29
  window.addEventListener("load", pageLoaded.step_func_done(function() {
30
    scrollingElement = document.scrollingElement;
31
    styledElement = document.documentElement;
32
    pageContent.style.width = (10 + window.innerWidth) * 5 + "px";
33
    pageContent.style.height = (20 + window.innerHeight) * 6 + "px";
34
    elementToRevealLeft = (10 + window.innerWidth) * 3;
35
    elementToRevealTop = (20 + window.innerHeight) * 4;
36
    elementToReveal.style.left = elementToRevealLeft + "px";
37
    elementToReveal.style.top = elementToRevealTop + "px";
38
39
    add_completion_callback(() => { resetScroll(scrollingElement); });
40
41
    ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
42
      promise_test(() => {
43
        resetScroll(scrollingElement);
44
        setScrollBehavior(styledElement, "autoBehavior");
45
        assert_equals(scrollingElement.scrollLeft, 0);
46
        assert_equals(scrollingElement.scrollTop, 0);
47
        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
48
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
49
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
50
        return new Promise((resolve) => { resolve(); });
51
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
52
53
      promise_test(() => {
54
        resetScroll(scrollingElement);
55
        setScrollBehavior(styledElement, "autoBehavior");
56
        assert_equals(scrollingElement.scrollLeft, 0);
57
        assert_equals(scrollingElement.scrollTop, 0);
58
        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
59
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
60
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
61
        return new Promise((resolve) => { resolve(); });
62
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
63
64
      promise_test(() => {
65
        resetScroll(scrollingElement);
66
        setScrollBehavior(styledElement, "autoBehavior");
67
        assert_equals(scrollingElement.scrollLeft, 0);
68
        assert_equals(scrollingElement.scrollTop, 0);
69
        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
70
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
71
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
72
        return new Promise((resolve) => { resolve(); });
73
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
74
75
      promise_test(() => {
76
        resetScroll(scrollingElement);
77
        setScrollBehavior(styledElement, "autoBehavior");
78
        assert_equals(scrollingElement.scrollLeft, 0);
79
        assert_equals(scrollingElement.scrollTop, 0);
80
        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
81
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
82
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
83
        return waitForScrollEnd(scrollingElement).then(() => {
84
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
85
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
86
        });
87
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
88
89
      promise_test(() => {
90
        resetScroll(scrollingElement);
91
        setScrollBehavior(styledElement, "smoothBehavior");
92
        assert_equals(scrollingElement.scrollLeft, 0);
93
        assert_equals(scrollingElement.scrollTop, 0);
94
        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
95
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
96
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
97
        return waitForScrollEnd(scrollingElement).then(() => {
98
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
99
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
100
        });
101
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
102
103
      promise_test(() => {
104
        resetScroll(scrollingElement);
105
        setScrollBehavior(styledElement, "smoothBehavior");
106
        assert_equals(scrollingElement.scrollLeft, 0);
107
        assert_equals(scrollingElement.scrollTop, 0);
108
        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
109
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
110
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
111
        return waitForScrollEnd(scrollingElement).then(() => {
112
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
113
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
114
        });
115
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
116
117
      promise_test(() => {
118
        resetScroll(scrollingElement);
119
        setScrollBehavior(styledElement, "smoothBehavior");
120
        assert_equals(scrollingElement.scrollLeft, 0);
121
        assert_equals(scrollingElement.scrollTop, 0);
122
        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
123
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
124
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
125
        return new Promise((resolve) => { resolve(); });
126
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
127
128
      promise_test(() => {
129
        resetScroll(scrollingElement);
130
        setScrollBehavior(styledElement, "smoothBehavior");
131
        assert_equals(scrollingElement.scrollLeft, 0);
132
        assert_equals(scrollingElement.scrollTop, 0);
133
        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
134
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
135
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
136
        return waitForScrollEnd(scrollingElement).then(() => {
137
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
138
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
139
        });
140
     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
141
    });
142
143
    promise_test(() => {
144
      resetScroll(scrollingElement);
145
      setScrollBehavior(styledElement, "smoothBehavior");
146
      assert_equals(scrollingElement.scrollLeft, 0);
147
      assert_equals(scrollingElement.scrollTop, 0);
148
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
149
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
150
      return waitForScrollEnd(scrollingElement).then(() => {
151
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
152
        assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
153
      });
154
    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
155
156
    promise_test(() => {
157
      resetScroll(scrollingElement);
158
      setScrollBehavior(styledElement, "smoothBehavior");
159
      assert_equals(scrollingElement.scrollLeft, 0);
160
      assert_equals(scrollingElement.scrollTop, 0);
161
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
162
      scrollNode(scrollingElement, "scroll", "instant", 0, 0);
163
      return waitForScrollEnd(scrollingElement).then(() => {
164
        assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
165
        assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
166
    });
167
  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
168
  }));
169
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-window-expected.txt +29 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-window-expected.txt_sec1
1
2
PASS Page loaded 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
29
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-window.html +170 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-main-frame-window.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* on the window of the main frame</title>
3
<meta name="timeout" content="long"/>
4
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
5
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
7
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
8
<script src="../../../resources/testharness.js"></script>
9
<script src="../../../resources/testharnessreport.js"></script>
10
<script src="resources/scroll-behavior.js"></script>
11
<style>
12
  body {
13
    margin: 0;
14
  }
15
  .autoBehavior {
16
    scroll-behavior: auto;
17
  }
18
  .smoothBehavior {
19
    scroll-behavior: smooth;
20
  }
21
</style>
22
<div id="log">
23
</div>
24
<div id="pageContent" style="position: absolute; left: 0; top: 0;">
25
  <div id="elementToReveal" style="position: absolute; display: inline-block; width: 10px; height: 15px; background: black;"></div>
26
</div>
27
<script>
28
  var pageLoaded = async_test("Page loaded");
29
  var scrollingWindow, styledElement, elementToRevealLeft, elementToRevealTop;
30
  window.addEventListener("load", pageLoaded.step_func_done(function() {
31
    scrollingWindow = window;
32
    styledElement = document.documentElement;
33
    pageContent.style.width = (10 + window.innerWidth) * 5 + "px";
34
    pageContent.style.height = (20 + window.innerHeight) * 6 + "px";
35
    elementToRevealLeft = (10 + window.innerWidth) * 3;
36
    elementToRevealTop = (20 + window.innerHeight) * 4;
37
    elementToReveal.style.left = elementToRevealLeft + "px";
38
    elementToReveal.style.top = elementToRevealTop + "px";
39
40
    add_completion_callback(() => { resetScrollForWindow(window); });
41
42
    ["scroll", "scrollTo", "scrollBy"].forEach((scrollFunction) => {
43
      promise_test(() => {
44
        resetScrollForWindow(scrollingWindow);
45
        setScrollBehavior(styledElement, "autoBehavior");
46
        assert_equals(scrollingWindow.scrollX, 0);
47
        assert_equals(scrollingWindow.scrollY, 0);
48
        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
49
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
50
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
51
        return new Promise((resolve) => { resolve(); });
52
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
53
54
      promise_test(() => {
55
        resetScrollForWindow(scrollingWindow);
56
        setScrollBehavior(styledElement, "autoBehavior");
57
        assert_equals(scrollingWindow.scrollX, 0);
58
        assert_equals(scrollingWindow.scrollY, 0);
59
        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
60
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
61
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
62
        return new Promise((resolve) => { resolve(); });
63
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
64
65
      promise_test(() => {
66
        resetScrollForWindow(scrollingWindow);
67
        setScrollBehavior(styledElement, "autoBehavior");
68
        assert_equals(scrollingWindow.scrollX, 0);
69
        assert_equals(scrollingWindow.scrollY, 0);
70
        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
71
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
72
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
73
        return new Promise((resolve) => { resolve(); });
74
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
75
76
      promise_test(() => {
77
        resetScrollForWindow(scrollingWindow);
78
        setScrollBehavior(styledElement, "autoBehavior");
79
        assert_equals(scrollingWindow.scrollX, 0);
80
        assert_equals(scrollingWindow.scrollY, 0);
81
        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
82
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
83
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
84
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
85
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
86
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
87
        });
88
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
89
90
      promise_test(() => {
91
        resetScrollForWindow(scrollingWindow);
92
        setScrollBehavior(styledElement, "smoothBehavior");
93
        assert_equals(scrollingWindow.scrollX, 0);
94
        assert_equals(scrollingWindow.scrollY, 0);
95
        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
96
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
97
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
98
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
99
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
100
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
101
        });
102
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
103
104
      promise_test(() => {
105
        resetScrollForWindow(scrollingWindow);
106
        setScrollBehavior(styledElement, "smoothBehavior");
107
        assert_equals(scrollingWindow.scrollX, 0);
108
        assert_equals(scrollingWindow.scrollY, 0);
109
        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
110
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
111
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
112
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
113
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
114
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
115
        });
116
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
117
118
      promise_test(() => {
119
        resetScrollForWindow(scrollingWindow);
120
        setScrollBehavior(styledElement, "smoothBehavior");
121
        assert_equals(scrollingWindow.scrollX, 0);
122
        assert_equals(scrollingWindow.scrollY, 0);
123
        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
124
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
125
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
126
        return new Promise((resolve) => { resolve(); });
127
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
128
129
      promise_test(() => {
130
        resetScrollForWindow(scrollingWindow);
131
        setScrollBehavior(styledElement, "smoothBehavior");
132
        assert_equals(scrollingWindow.scrollX, 0);
133
        assert_equals(scrollingWindow.scrollY, 0);
134
        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
135
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
136
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
137
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
138
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
139
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
140
        });
141
     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
142
    });
143
144
    promise_test(() => {
145
      resetScrollForWindow(scrollingWindow);
146
      setScrollBehavior(styledElement, "smoothBehavior");
147
      assert_equals(scrollingWindow.scrollX, 0);
148
      assert_equals(scrollingWindow.scrollY, 0);
149
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
150
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
151
      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
152
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft / 2, "Final value of scrollLeft");
153
        assert_equals(scrollingWindow.scrollY, elementToRevealTop / 2, "Final value of scrollTop");
154
      });
155
    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
156
157
    promise_test(() => {
158
      resetScrollForWindow(scrollingWindow);
159
      setScrollBehavior(styledElement, "smoothBehavior");
160
      assert_equals(scrollingWindow.scrollX, 0);
161
      assert_equals(scrollingWindow.scrollY, 0);
162
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
163
      scrollWindow(scrollingWindow, "scroll", "instant", 0, 0);
164
      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
165
        assert_equals(scrollingWindow.scrollX, 0, "Final value of scrollLeft");
166
        assert_equals(scrollingWindow.scrollY, 0, "Final value of scrollTop");
167
    });
168
  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
169
  }));
170
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-scrollintoview-nested-expected.txt +3 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-scrollintoview-nested-expected.txt_sec1
1
2
PASS scrollIntoView with nested elements with different scroll-behavior 
3
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-scrollintoview-nested.html +88 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-scrollintoview-nested.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior with scrollIntoView for nested scrolling nodes</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<style>
11
  .scrollable {
12
    overflow: auto;
13
    height: 200px;
14
  }
15
  .smoothBehavior {
16
    scroll-behavior: smooth;
17
  }
18
  .gradient {
19
    background: linear-gradient(135deg, red, green);
20
  }
21
</style>
22
<div id="log">
23
</div>
24
<div>
25
  <div class="scrollable smoothBehavior" style="width: 450px">
26
    <div class="gradient" style="width: 100px; height: 500px;"></div>
27
    <div class="scrollable smoothBehavior" style="width: 400px">
28
      <div class="gradient" style="width: 100px; height: 500px;"></div>
29
      <div class="scrollable" style="width: 350px">
30
        <div class="gradient" style="width: 100px; height: 500px;"></div>
31
        <div class="scrollable" style="width: 300px">
32
          <div class="gradient" style="width: 100px; height: 500px;"></div>
33
          <div class="scrollable smoothBehavior" style="width: 250px">
34
            <div class="gradient" style="width: 100px; height: 500px;"></div>
35
            <div class="scrollable" style="width: 200px">
36
              <div class="gradient" style="width: 100px; height: 500px;"></div>
37
              <div id="elementToReveal" style="width: 10px; height: 10px; background: black;"></div>
38
              <div class="gradient" style="width: 100px; height: 500px;"></div>
39
            </div>
40
            <div class="gradient" style="width: 100px; height: 500px;"></div>
41
          </div>
42
          <div class="gradient" style="width: 100px; height: 500px;"></div>
43
        </div>
44
      <div class="gradient" style="width: 100px; height: 500px;"></div>
45
      </div>
46
      <div class="gradient" style="width: 100px; height: 500px;"></div>
47
    </div>
48
  </div>
49
</div>
50
<script>
51
  // The CSSOM-View spec and implementations follow different algorithms (scrolls performed in parallel, as inner-to-outer sequence or as outer-to-inner sequence).
52
  // See https://github.com/w3c/csswg-drafts/issues/3127
53
  promise_test(() => {
54
    return new Promise(function(resolve, reject) {
55
      var divs = document.querySelectorAll(".scrollable");
56
      divs.forEach((scrollableDiv) => {
57
        resetScroll(scrollableDiv);
58
      });
59
      elementToReveal.scrollIntoView({inline: "start", block: "start", behavior: "auto"});
60
      var scrollTop = new Map();
61
      var isSmooth = new Map();
62
      divs.forEach((scrollableDiv) => {
63
        scrollTop.set(scrollableDiv, scrollableDiv.scrollTop);
64
        isSmooth.set(scrollableDiv, scrollableDiv.classList.contains("smoothBehavior"));
65
        // If scroll operations are not performed in parallel, scroll boxes with instant behavior might also need to wait for their predecessors.
66
        if (isSmooth.get(scrollableDiv))
67
          assert_less_than(scrollTop.get(scrollableDiv), 500, "Element with smooth behavior should not scroll immediately");
68
      });
69
70
      observeScrolling(Array.from(divs), function(done) {
71
        try {
72
          divs.forEach((scrollableDiv) => {
73
            assert_less_than_equal(scrollTop.get(scrollableDiv), scrollableDiv.scrollTop, "ScrollTop keeps increasing");
74
            if (!isSmooth.get(scrollableDiv))
75
              assert_any(assert_equals, scrollableDiv.scrollTop, [0, 500], "Element with instant behavior should jump to the final position");
76
            if (done)
77
              assert_equals(scrollableDiv.scrollTop, 500, "Final value of scrollTop");
78
            scrollTop.set(scrollableDiv, scrollableDiv.scrollTop);
79
          });
80
        } catch(e) {
81
          reject(e);
82
        }
83
        if (done)
84
          resolve();
85
      });
86
    });
87
  }, "scrollIntoView with nested elements with different scroll-behavior");
88
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-smooth-positions-expected.txt +20 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-smooth-positions-expected.txt_sec1
1
2
PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scroll()  
3
PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scroll()  
4
PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scroll()  
5
PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scroll()  
6
PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollTo()  
7
PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollTo()  
8
PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollTo()  
9
PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollTo()  
10
PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollBy()  
11
PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollBy()  
12
PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollBy()  
13
PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollBy()  
14
PASS Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollIntoView()  
15
PASS Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollIntoView()  
16
PASS Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollIntoView()  
17
PASS Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollIntoView()  
18
PASS Scroll positions when aborting a smooth scrolling with another smooth scrolling 
19
PASS Scroll positions when aborting a smooth scrolling with an instant scrolling 
20
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-smooth-positions.html +151 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-smooth-positions.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true ] -->
2
<title>Testing scroll positions when scrolling an element with smooth behavior</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<style>
11
  .scrollable {
12
    overflow: auto;
13
    width: 400px;
14
    height: 200px;
15
    scroll-behavior: smooth;
16
  }
17
</style>
18
<div id="log">
19
</div>
20
<div id="overflowNode" class="scrollable">
21
  <div style="width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);">
22
    <span style="display: inline-block; width: 500px; height: 250px;"></span><span id="elementToReveal" style="display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;"></span>
23
  </div>
24
</div>
25
<script>
26
  // For smooth behavior, evolution of scroll positions over time is not specified by CSSOM View.
27
  // This test relies on the minimal assumption that scroll position functions are monotonic.
28
  ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach(function(scrollFunction) {
29
    [{left:0, top:0}, {left:1000, top:0}, {left:0, top:500}, {left:1000, top:500}].forEach((initial) => {
30
      var finalLeft = 500;
31
      var finalTop = 250;
32
      promise_test(() => {
33
        return new Promise(function(resolve, reject) {
34
          scrollNode(overflowNode, "scroll", "instant", initial.left, initial.top);
35
          var oldLeft = overflowNode.scrollLeft;
36
          var oldTop = overflowNode.scrollTop;
37
          assert_equals(oldLeft, initial.left, "ScrollLeft should be at initial position");
38
          assert_equals(oldTop, initial.top, "ScrollTop should be at initial position");
39
          if (scrollFunction === "scrollBy")
40
            scrollNode(overflowNode, scrollFunction, "smooth", finalLeft - initial.left, finalTop - initial.top);
41
          else
42
            scrollNode(overflowNode, scrollFunction, "smooth", finalLeft, finalTop);
43
          observeScrolling(overflowNode, function(done) {
44
            try {
45
              var newLeft = overflowNode.scrollLeft;
46
              var newTop = overflowNode.scrollTop;
47
              assert_less_than_equal(Math.hypot(finalLeft - newLeft, finalTop - newTop), Math.hypot(finalLeft - oldLeft, finalTop - oldTop), "Scroll position should move towards the final position");
48
              if (done) {
49
                assert_equals(newLeft, finalLeft, "ScrollLeft should reach final position");
50
                assert_equals(newTop, finalTop, "ScrollTop should reach final position");
51
              }
52
              oldLeft = newLeft;
53
              oldTop = newTop;
54
            } catch(e) {
55
              reject(e);
56
            }
57
            if (done)
58
              resolve();
59
          });
60
        });
61
      }, `Scroll positions when performing smooth scrolling from (${initial.left}, ${initial.top}) to (${finalLeft}, ${finalTop}) using ${scrollFunction}() `);
62
    });
63
  });
64
65
  promise_test(() => {
66
    return new Promise(function(resolve, reject) {
67
      resetScroll(overflowNode);
68
      var initialScrollAborted = false;
69
      var scrollDirectionChanged = false;
70
      var oldLeft = overflowNode.scrollLeft;
71
      var oldTop = overflowNode.scrollTop;
72
      assert_equals(oldLeft, 0);
73
      assert_equals(oldTop, 0);
74
      scrollNode(overflowNode, "scroll", "smooth", 1500, 750);
75
      observeScrolling(overflowNode, function(done) {
76
        try {
77
          var newLeft = overflowNode.scrollLeft;
78
          var newTop = overflowNode.scrollTop;
79
          if (initialScrollAborted) {
80
            if (scrollDirectionChanged) {
81
              assert_greater_than_equal(oldLeft, newLeft, "ScrollLeft keeps decreasing");
82
              assert_greater_than_equal(oldTop, newTop, "ScrollTop keeps decreasing");
83
            } else
84
              scrollDirectionChanged = newLeft <= oldLeft && newTop <= oldTop;
85
          } else {
86
              assert_less_than_equal(oldLeft, newLeft, "ScrollLeft keeps increasing");
87
              assert_less_than_equal(oldTop, newTop, "ScrollTop keeps increasing");
88
              if (newLeft > 1000 && newTop > 500) {
89
                // Abort the initial scroll.
90
                initialScrollAborted = true;
91
                scrollNode(overflowNode, "scroll", "smooth", 500, 250);
92
                newLeft = overflowNode.scrollLeft;
93
                newTop = overflowNode.scrollTop;
94
              }
95
          }
96
          if (done) {
97
            assert_equals(newLeft, 500, "ScrollLeft should reach final position");
98
            assert_equals(newTop, 250, "ScrollTop should reach final position");
99
          }
100
          oldLeft = newLeft;
101
          oldTop = newTop;
102
        } catch(e) {
103
          reject(e);
104
        }
105
        if (done)
106
          resolve();
107
      });
108
    });
109
  }, "Scroll positions when aborting a smooth scrolling with another smooth scrolling");
110
111
  promise_test(() => {
112
    return new Promise(function(resolve, reject) {
113
      resetScroll(overflowNode);
114
      var initialScrollAborted = false;
115
      var oldLeft = overflowNode.scrollLeft;
116
      var oldTop = overflowNode.scrollTop;
117
      assert_equals(oldLeft, 0);
118
      assert_equals(oldTop, 0);
119
      scrollNode(overflowNode, "scroll", "smooth", 1500, 750);
120
      observeScrolling(overflowNode, function(done) {
121
        try {
122
          var newLeft = overflowNode.scrollLeft;
123
          var newTop = overflowNode.scrollTop;
124
          if (!initialScrollAborted) {
125
              assert_less_than_equal(oldLeft, newLeft, "ScrollLeft keeps increasing");
126
              assert_less_than_equal(oldTop, newTop, "ScrollTop keeps increasing");
127
              if (newLeft > 1000 && newTop > 500) {
128
                // Abort the initial scroll.
129
                initialScrollAborted = true;
130
                scrollNode(overflowNode, "scroll", "instant", 500, 250);
131
                newLeft = overflowNode.scrollLeft;
132
                newTop = overflowNode.scrollTop;
133
                assert_equals(newLeft, 500, "ScrollLeft should reach final position");
134
                assert_equals(newTop, 250, "ScrollTop should reach final position");
135
              }
136
          }
137
          if (done) {
138
            assert_equals(newLeft, 500, "ScrollLeft should stay at final position");
139
            assert_equals(newTop, 250, "ScrollTop should stay at final position");
140
          }
141
          oldLeft = newLeft;
142
          oldTop = newTop;
143
        } catch(e) {
144
          reject(e);
145
        }
146
        if (done)
147
          resolve();
148
      });
149
    });
150
  }, "Scroll positions when aborting a smooth scrolling with an instant scrolling");
151
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-root-expected.txt +37 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-root-expected.txt_sec1
1
2
PASS iframe loaded 
3
PASS Subframe with auto scroll-behavior ; scroll() with default behavior 
4
PASS Subframe with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Subframe with auto scroll-behavior ; scroll() with instant behavior 
6
PASS Subframe with auto scroll-behavior ; scroll() with smooth behavior 
7
PASS Subframe with smooth scroll-behavior ; scroll() with default behavior 
8
PASS Subframe with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Subframe with smooth scroll-behavior ; scroll() with instant behavior 
10
PASS Subframe with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Subframe with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Subframe with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Subframe with auto scroll-behavior ; scrollTo() with instant behavior 
14
PASS Subframe with auto scroll-behavior ; scrollTo() with smooth behavior 
15
PASS Subframe with smooth scroll-behavior ; scrollTo() with default behavior 
16
PASS Subframe with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Subframe with smooth scroll-behavior ; scrollTo() with instant behavior 
18
PASS Subframe with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Subframe with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Subframe with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Subframe with auto scroll-behavior ; scrollBy() with instant behavior 
22
PASS Subframe with auto scroll-behavior ; scrollBy() with smooth behavior 
23
PASS Subframe with smooth scroll-behavior ; scrollBy() with default behavior 
24
PASS Subframe with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Subframe with smooth scroll-behavior ; scrollBy() with instant behavior 
26
PASS Subframe with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Subframe with auto scroll-behavior ; scrollIntoView() with default behavior 
28
PASS Subframe with auto scroll-behavior ; scrollIntoView() with auto behavior 
29
PASS Subframe with auto scroll-behavior ; scrollIntoView() with instant behavior 
30
PASS Subframe with auto scroll-behavior ; scrollIntoView() with smooth behavior 
31
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with default behavior 
32
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with auto behavior 
33
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with instant behavior 
34
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
35
PASS Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling 
36
PASS Aborting an ongoing smooth scrolling on a subframe with an instant scrolling 
37
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-root.html +170 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-root.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<div id="log">
11
</div>
12
<iframe id="iframeNode" width="400px" height="200px" srcdoc="<!DOCTYPE>
13
<html>
14
  <style>
15
    body {
16
      margin: 0;
17
    }
18
    .autoBehavior {
19
      scroll-behavior: auto;
20
    }
21
    .smoothBehavior {
22
      scroll-behavior: smooth;
23
    }
24
  </style>
25
  <body>
26
    <div style='width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);'>
27
      <span style='display: inline-block; width: 500px; height: 250px;'></span><span id='elementToReveal' style='display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;'></span>
28
    </div>
29
  </body>
30
</html>">
31
</iframe>
32
<script>
33
  var iframeLoadTest = async_test("iframe loaded");
34
  var scrollingElement, styledElement, elementToReveal;
35
  var elementToRevealLeft = 500;
36
  var elementToRevealTop = 250;
37
  iframeNode.addEventListener("load", iframeLoadTest.step_func_done(() => {
38
    scrollingElement = iframeNode.contentDocument.scrollingElement;
39
    styledElement = iframeNode.contentDocument.documentElement;
40
    elementToReveal = iframeNode.contentDocument.getElementById("elementToReveal");
41
42
    ["scroll", "scrollTo", "scrollBy", "scrollIntoView"].forEach((scrollFunction) => {
43
      promise_test(() => {
44
        resetScroll(scrollingElement);
45
        setScrollBehavior(styledElement, "autoBehavior");
46
        assert_equals(scrollingElement.scrollLeft, 0);
47
        assert_equals(scrollingElement.scrollTop, 0);
48
        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
49
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
50
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
51
        return new Promise((resolve) => { resolve(); });
52
      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
53
54
      promise_test(() => {
55
        resetScroll(scrollingElement);
56
        setScrollBehavior(styledElement, "autoBehavior");
57
        assert_equals(scrollingElement.scrollLeft, 0);
58
        assert_equals(scrollingElement.scrollTop, 0);
59
        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
60
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
61
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
62
        return new Promise((resolve) => { resolve(); });
63
      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
64
65
      promise_test(() => {
66
        resetScroll(scrollingElement);
67
        setScrollBehavior(styledElement, "autoBehavior");
68
        assert_equals(scrollingElement.scrollLeft, 0);
69
        assert_equals(scrollingElement.scrollTop, 0);
70
        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
71
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
72
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
73
        return new Promise((resolve) => { resolve(); });
74
      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
75
76
      promise_test(() => {
77
        resetScroll(scrollingElement);
78
        setScrollBehavior(styledElement, "autoBehavior");
79
        assert_equals(scrollingElement.scrollLeft, 0);
80
        assert_equals(scrollingElement.scrollTop, 0);
81
        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
82
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
83
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
84
        return waitForScrollEnd(scrollingElement).then(() => {
85
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
86
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
87
        });
88
      }, `Subframe with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
89
90
      promise_test(() => {
91
        resetScroll(scrollingElement);
92
        setScrollBehavior(styledElement, "smoothBehavior");
93
        assert_equals(scrollingElement.scrollLeft, 0);
94
        assert_equals(scrollingElement.scrollTop, 0);
95
        scrollNode(scrollingElement, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
96
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
97
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
98
        return waitForScrollEnd(scrollingElement).then(() => {
99
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
100
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
101
        });
102
      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
103
104
      promise_test(() => {
105
        resetScroll(scrollingElement);
106
        setScrollBehavior(styledElement, "smoothBehavior");
107
        assert_equals(scrollingElement.scrollLeft, 0);
108
        assert_equals(scrollingElement.scrollTop, 0);
109
        scrollNode(scrollingElement, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
110
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
111
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
112
        return waitForScrollEnd(scrollingElement).then(() => {
113
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
114
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
115
        });
116
      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
117
118
      promise_test(() => {
119
        resetScroll(scrollingElement);
120
        setScrollBehavior(styledElement, "smoothBehavior");
121
        assert_equals(scrollingElement.scrollLeft, 0);
122
        assert_equals(scrollingElement.scrollTop, 0);
123
        scrollNode(scrollingElement, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
124
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Should set scrollLeft immediately");
125
        assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Should set scrollTop immediately");
126
        return new Promise((resolve) => { resolve(); });
127
      }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
128
129
      promise_test(() => {
130
        resetScroll(scrollingElement);
131
        setScrollBehavior(styledElement, "smoothBehavior");
132
        assert_equals(scrollingElement.scrollLeft, 0);
133
        assert_equals(scrollingElement.scrollTop, 0);
134
        scrollNode(scrollingElement, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
135
        assert_less_than(scrollingElement.scrollLeft, elementToRevealLeft, "Should not set scrollLeft immediately");
136
        assert_less_than(scrollingElement.scrollTop, elementToRevealTop, "Should not set scrollTop immediately");
137
        return waitForScrollEnd(scrollingElement).then(() => {
138
          assert_equals(scrollingElement.scrollLeft, elementToRevealLeft, "Final value of scrollLeft");
139
          assert_equals(scrollingElement.scrollTop, elementToRevealTop, "Final value of scrollTop");
140
        });
141
     }, `Subframe with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
142
    });
143
144
    promise_test(() => {
145
      resetScroll(scrollingElement);
146
      setScrollBehavior(styledElement, "smoothBehavior");
147
      assert_equals(scrollingElement.scrollLeft, 0);
148
      assert_equals(scrollingElement.scrollTop, 0);
149
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
150
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
151
      return waitForScrollEnd(scrollingElement).then(() => {
152
        assert_equals(scrollingElement.scrollLeft, elementToRevealLeft / 2, "Final value of scrollLeft");
153
        assert_equals(scrollingElement.scrollTop, elementToRevealTop / 2, "Final value of scrollTop");
154
      });
155
    }, "Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling");
156
157
    promise_test(() => {
158
      resetScroll(scrollingElement);
159
      setScrollBehavior(styledElement, "smoothBehavior");
160
      assert_equals(scrollingElement.scrollLeft, 0);
161
      assert_equals(scrollingElement.scrollTop, 0);
162
      scrollNode(scrollingElement, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
163
      scrollNode(scrollingElement, "scroll", "instant", 0, 0);
164
      return waitForScrollEnd(scrollingElement).then(() => {
165
        assert_equals(scrollingElement.scrollLeft, 0, "Final value of scrollLeft");
166
        assert_equals(scrollingElement.scrollTop, 0, "Final value of scrollTop");
167
    });
168
  }, "Aborting an ongoing smooth scrolling on a subframe with an instant scrolling");
169
  }));
170
</script>
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-window-expected.txt +29 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-window-expected.txt_sec1
1
2
PASS iframe loaded 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
29
- a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-window.html +171 lines
Line 0 a/LayoutTests/fast/scrolling/ios/scroll-behavior-subframe-window.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true  internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
5
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
6
<link rel="help" href="https://drafts.csswg.org/cssom-view/#scrolling-box">
7
<script src="../../../resources/testharness.js"></script>
8
<script src="../../../resources/testharnessreport.js"></script>
9
<script src="resources/scroll-behavior.js"></script>
10
<div id="log">
11
</div>
12
<iframe id="iframeNode" width="400px" height="200px" srcdoc="<!DOCTYPE>
13
<html>
14
  <style>
15
    body {
16
      margin: 0;
17
    }
18
    .autoBehavior {
19
      scroll-behavior: auto;
20
    }
21
    .smoothBehavior {
22
      scroll-behavior: smooth;
23
    }
24
  </style>
25
  <body>
26
    <div style='width: 2000px; height: 1000px; background: linear-gradient(135deg, red, green);'>
27
      <span style='display: inline-block; width: 500px; height: 250px;'></span><span id='elementToReveal' style='display: inline-block; vertical-align: -15px; width: 10px; height: 15px; background: black;'></span>
28
    </div>
29
  </body>
30
</html>">
31
</iframe>
32
<script>
33
  var iframeLoadTest = async_test("iframe loaded");
34
  var scrollingWindow, styledElement, elementToReveal;
35
  var elementToRevealLeft = 500;
36
  var elementToRevealTop = 250;
37
  iframeNode.addEventListener("load", iframeLoadTest.step_func_done(() => {
38
    scrollingWindow = iframeNode.contentWindow;
39
    styledElement = iframeNode.contentDocument.documentElement;
40
    elementToReveal = iframeNode.contentDocument.getElementById("elementToReveal");
41
42
    ["scroll", "scrollTo", "scrollBy"].forEach((scrollFunction) => {
43
      promise_test(() => {
44
        resetScrollForWindow(scrollingWindow);
45
        setScrollBehavior(styledElement, "autoBehavior");
46
        assert_equals(scrollingWindow.scrollX, 0);
47
        assert_equals(scrollingWindow.scrollY, 0);
48
        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
49
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
50
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
51
        return new Promise((resolve) => { resolve(); });
52
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with default behavior`);
53
54
      promise_test(() => {
55
        resetScrollForWindow(scrollingWindow);
56
        setScrollBehavior(styledElement, "autoBehavior");
57
        assert_equals(scrollingWindow.scrollX, 0);
58
        assert_equals(scrollingWindow.scrollY, 0);
59
        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
60
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
61
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
62
        return new Promise((resolve) => { resolve(); });
63
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with auto behavior`);
64
65
      promise_test(() => {
66
        resetScrollForWindow(scrollingWindow);
67
        setScrollBehavior(styledElement, "autoBehavior");
68
        assert_equals(scrollingWindow.scrollX, 0);
69
        assert_equals(scrollingWindow.scrollY, 0);
70
        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
71
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
72
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
73
        return new Promise((resolve) => { resolve(); });
74
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with instant behavior`);
75
76
      promise_test(() => {
77
        resetScrollForWindow(scrollingWindow);
78
        setScrollBehavior(styledElement, "autoBehavior");
79
        assert_equals(scrollingWindow.scrollX, 0);
80
        assert_equals(scrollingWindow.scrollY, 0);
81
        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
82
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
83
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
84
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
85
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
86
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
87
        });
88
      }, `Main frame with auto scroll-behavior ; ${scrollFunction}() with smooth behavior`);
89
90
      promise_test(() => {
91
        resetScrollForWindow(scrollingWindow);
92
        setScrollBehavior(styledElement, "smoothBehavior");
93
        assert_equals(scrollingWindow.scrollX, 0);
94
        assert_equals(scrollingWindow.scrollY, 0);
95
        scrollWindow(scrollingWindow, scrollFunction, null, elementToRevealLeft, elementToRevealTop);
96
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
97
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
98
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
99
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
100
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
101
        });
102
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with default behavior`);
103
104
      promise_test(() => {
105
        resetScrollForWindow(scrollingWindow);
106
        setScrollBehavior(styledElement, "smoothBehavior");
107
        assert_equals(scrollingWindow.scrollX, 0);
108
        assert_equals(scrollingWindow.scrollY, 0);
109
        scrollWindow(scrollingWindow, scrollFunction, "auto", elementToRevealLeft, elementToRevealTop);
110
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
111
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
112
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
113
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
114
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
115
        });
116
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with auto behavior`);
117
118
      promise_test(() => {
119
        resetScrollForWindow(scrollingWindow);
120
        setScrollBehavior(styledElement, "smoothBehavior");
121
        assert_equals(scrollingWindow.scrollX, 0);
122
        assert_equals(scrollingWindow.scrollY, 0);
123
        scrollWindow(scrollingWindow, scrollFunction, "instant", elementToRevealLeft, elementToRevealTop);
124
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Should set scrollLeft immediately");
125
        assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Should set scrollTop immediately");
126
        return new Promise((resolve) => { resolve(); });
127
      }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with instant behavior`);
128
129
      promise_test(() => {
130
        resetScrollForWindow(scrollingWindow);
131
        setScrollBehavior(styledElement, "smoothBehavior");
132
        assert_equals(scrollingWindow.scrollX, 0);
133
        assert_equals(scrollingWindow.scrollY, 0);
134
        scrollWindow(scrollingWindow, scrollFunction, "smooth", elementToRevealLeft, elementToRevealTop);
135
        assert_less_than(scrollingWindow.scrollX, elementToRevealLeft, "Should not set scrollLeft immediately");
136
        assert_less_than(scrollingWindow.scrollY, elementToRevealTop, "Should not set scrollTop immediately");
137
        return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
138
          assert_equals(scrollingWindow.scrollX, elementToRevealLeft, "Final value of scrollLeft");
139
          assert_equals(scrollingWindow.scrollY, elementToRevealTop, "Final value of scrollTop");
140
        });
141
     }, `Main frame with smooth scroll-behavior ; ${scrollFunction}() with smooth behavior`);
142
    });
143
144
    promise_test(() => {
145
      resetScrollForWindow(scrollingWindow);
146
      setScrollBehavior(styledElement, "smoothBehavior");
147
      assert_equals(scrollingWindow.scrollX, 0);
148
      assert_equals(scrollingWindow.scrollY, 0);
149
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
150
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft / 2, elementToRevealTop / 2);
151
      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
152
        assert_equals(scrollingWindow.scrollX, elementToRevealLeft / 2, "Final value of scrollLeft");
153
        assert_equals(scrollingWindow.scrollY, elementToRevealTop / 2, "Final value of scrollTop");
154
      });
155
    }, "Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling");
156
157
    promise_test(() => {
158
      resetScrollForWindow(scrollingWindow);
159
      setScrollBehavior(styledElement, "smoothBehavior");
160
      assert_equals(scrollingWindow.scrollX, 0);
161
      assert_equals(scrollingWindow.scrollY, 0);
162
      scrollWindow(scrollingWindow, "scroll", "smooth", elementToRevealLeft, elementToRevealTop);
163
      scrollWindow(scrollingWindow, "scroll", "instant", 0, 0);
164
      return waitForScrollEnd(scrollingWindow.document.scrollingElement).then(() => {
165
        assert_equals(scrollingWindow.scrollX, 0, "Final value of scrollLeft");
166
        assert_equals(scrollingWindow.scrollY, 0, "Final value of scrollTop");
167
    });
168
  }, "Aborting an ongoing smooth scrolling on the main frame with an instant scrolling");
169
170
  }));
171
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt -2 / +2 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance-expected.txt_sec1
1
1
2
FAIL Property scroll-behavior has initial value auto assert_true: scroll-behavior doesn't seem to be supported in the computed style expected true got false
2
PASS Property scroll-behavior has initial value auto 
3
FAIL Property scroll-behavior does not inherit assert_true: expected true got false
3
PASS Property scroll-behavior does not inherit 
4
4
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt_sec1
1
1
2
PASS Instant scrolling of an element with default scroll-behavior 
2
PASS Instant scrolling of an element with default scroll-behavior 
3
FAIL Smooth scrolling of an element with default scroll-behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
3
PASS Smooth scrolling of an element with default scroll-behavior 
4
4
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing default value of scroll-behavior</title>
2
<title>Testing default value of scroll-behavior</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt -16 / +16 lines
Lines 2-36 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt_sec1
2
PASS Element with auto scroll-behavior ; scroll() with default behavior 
2
PASS Element with auto scroll-behavior ; scroll() with default behavior 
3
PASS Element with auto scroll-behavior ; scroll() with auto behavior 
3
PASS Element with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Element with auto scroll-behavior ; scroll() with instant behavior 
4
PASS Element with auto scroll-behavior ; scroll() with instant behavior 
5
FAIL Element with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
5
PASS Element with auto scroll-behavior ; scroll() with smooth behavior 
6
FAIL Element with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
6
PASS Element with smooth scroll-behavior ; scroll() with default behavior 
7
FAIL Element with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
7
PASS Element with smooth scroll-behavior ; scroll() with auto behavior 
8
PASS Element with smooth scroll-behavior ; scroll() with instant behavior 
8
PASS Element with smooth scroll-behavior ; scroll() with instant behavior 
9
FAIL Element with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
9
PASS Element with smooth scroll-behavior ; scroll() with smooth behavior 
10
PASS Element with auto scroll-behavior ; scrollTo() with default behavior 
10
PASS Element with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Element with auto scroll-behavior ; scrollTo() with auto behavior 
11
PASS Element with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Element with auto scroll-behavior ; scrollTo() with instant behavior 
12
PASS Element with auto scroll-behavior ; scrollTo() with instant behavior 
13
FAIL Element with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
13
PASS Element with auto scroll-behavior ; scrollTo() with smooth behavior 
14
FAIL Element with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
14
PASS Element with smooth scroll-behavior ; scrollTo() with default behavior 
15
FAIL Element with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
15
PASS Element with smooth scroll-behavior ; scrollTo() with auto behavior 
16
PASS Element with smooth scroll-behavior ; scrollTo() with instant behavior 
16
PASS Element with smooth scroll-behavior ; scrollTo() with instant behavior 
17
FAIL Element with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
17
PASS Element with smooth scroll-behavior ; scrollTo() with smooth behavior 
18
PASS Element with auto scroll-behavior ; scrollBy() with default behavior 
18
PASS Element with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Element with auto scroll-behavior ; scrollBy() with auto behavior 
19
PASS Element with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Element with auto scroll-behavior ; scrollBy() with instant behavior 
20
PASS Element with auto scroll-behavior ; scrollBy() with instant behavior 
21
FAIL Element with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
21
PASS Element with auto scroll-behavior ; scrollBy() with smooth behavior 
22
FAIL Element with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
22
PASS Element with smooth scroll-behavior ; scrollBy() with default behavior 
23
FAIL Element with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
23
PASS Element with smooth scroll-behavior ; scrollBy() with auto behavior 
24
PASS Element with smooth scroll-behavior ; scrollBy() with instant behavior 
24
PASS Element with smooth scroll-behavior ; scrollBy() with instant behavior 
25
FAIL Element with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
25
PASS Element with smooth scroll-behavior ; scrollBy() with smooth behavior 
26
PASS Element with auto scroll-behavior ; scrollIntoView() with default behavior 
26
PASS Element with auto scroll-behavior ; scrollIntoView() with default behavior 
27
PASS Element with auto scroll-behavior ; scrollIntoView() with auto behavior 
27
PASS Element with auto scroll-behavior ; scrollIntoView() with auto behavior 
28
PASS Element with auto scroll-behavior ; scrollIntoView() with instant behavior 
28
PASS Element with auto scroll-behavior ; scrollIntoView() with instant behavior 
29
FAIL Element with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
29
PASS Element with auto scroll-behavior ; scrollIntoView() with smooth behavior 
30
FAIL Element with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
30
PASS Element with smooth scroll-behavior ; scrollIntoView() with default behavior 
31
FAIL Element with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
31
PASS Element with smooth scroll-behavior ; scrollIntoView() with auto behavior 
32
PASS Element with smooth scroll-behavior ; scrollIntoView() with instant behavior 
32
PASS Element with smooth scroll-behavior ; scrollIntoView() with instant behavior 
33
FAIL Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
33
PASS Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
34
PASS Aborting an ongoing smooth scrolling on an element with another smooth scrolling 
34
PASS Aborting an ongoing smooth scrolling on an element with another smooth scrolling 
35
PASS Aborting an ongoing smooth scrolling on an element with an instant scrolling 
35
PASS Aborting an ongoing smooth scrolling on an element with an instant scrolling 
36
36
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on an element</title>
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on an element</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt -16 / +16 lines
Lines 3-37 PASS Page loaded a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt_sec1
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Main frame with auto scroll-behavior ; scrollIntoView() with default behavior 
27
PASS Main frame with auto scroll-behavior ; scrollIntoView() with default behavior 
28
PASS Main frame with auto scroll-behavior ; scrollIntoView() with auto behavior 
28
PASS Main frame with auto scroll-behavior ; scrollIntoView() with auto behavior 
29
PASS Main frame with auto scroll-behavior ; scrollIntoView() with instant behavior 
29
PASS Main frame with auto scroll-behavior ; scrollIntoView() with instant behavior 
30
FAIL Main frame with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
30
PASS Main frame with auto scroll-behavior ; scrollIntoView() with smooth behavior 
31
FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
31
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with default behavior 
32
FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
32
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with auto behavior 
33
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with instant behavior 
33
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with instant behavior 
34
FAIL Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
34
PASS Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
35
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
35
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
36
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
36
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
37
37
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of the main frame</title>
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of the main frame</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt -12 / +12 lines
Lines 3-29 PASS Page loaded a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt_sec1
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 2430 but got 2430
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
29
29
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* on the window of the main frame</title>
2
<title>Testing scrollOptions' behavior for Element.scroll* on the window of the main frame</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
4
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt -1 / +1 lines
Lines 1-3 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt_sec1
1
1
2
FAIL scrollIntoView with nested elements with different scroll-behavior assert_less_than: Element with smooth behavior should not scroll immediately expected a number less than 500 but got 500
2
PASS scrollIntoView with nested elements with different scroll-behavior 
3
3
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior with scrollIntoView for nested scrolling nodes</title>
2
<title>Testing scrollOptions' behavior with scrollIntoView for nested scrolling nodes</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scroll positions when scrolling an element with smooth behavior</title>
2
<title>Testing scroll positions when scrolling an element with smooth behavior</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt -16 / +16 lines
Lines 3-37 PASS iframe loaded a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt_sec1
3
PASS Subframe with auto scroll-behavior ; scroll() with default behavior 
3
PASS Subframe with auto scroll-behavior ; scroll() with default behavior 
4
PASS Subframe with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Subframe with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Subframe with auto scroll-behavior ; scroll() with instant behavior 
5
PASS Subframe with auto scroll-behavior ; scroll() with instant behavior 
6
FAIL Subframe with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
6
PASS Subframe with auto scroll-behavior ; scroll() with smooth behavior 
7
FAIL Subframe with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
7
PASS Subframe with smooth scroll-behavior ; scroll() with default behavior 
8
FAIL Subframe with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
8
PASS Subframe with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Subframe with smooth scroll-behavior ; scroll() with instant behavior 
9
PASS Subframe with smooth scroll-behavior ; scroll() with instant behavior 
10
FAIL Subframe with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
10
PASS Subframe with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Subframe with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Subframe with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Subframe with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Subframe with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Subframe with auto scroll-behavior ; scrollTo() with instant behavior 
13
PASS Subframe with auto scroll-behavior ; scrollTo() with instant behavior 
14
FAIL Subframe with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
14
PASS Subframe with auto scroll-behavior ; scrollTo() with smooth behavior 
15
FAIL Subframe with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
15
PASS Subframe with smooth scroll-behavior ; scrollTo() with default behavior 
16
FAIL Subframe with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
16
PASS Subframe with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Subframe with smooth scroll-behavior ; scrollTo() with instant behavior 
17
PASS Subframe with smooth scroll-behavior ; scrollTo() with instant behavior 
18
FAIL Subframe with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
18
PASS Subframe with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Subframe with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Subframe with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Subframe with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Subframe with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Subframe with auto scroll-behavior ; scrollBy() with instant behavior 
21
PASS Subframe with auto scroll-behavior ; scrollBy() with instant behavior 
22
FAIL Subframe with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
22
PASS Subframe with auto scroll-behavior ; scrollBy() with smooth behavior 
23
FAIL Subframe with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
23
PASS Subframe with smooth scroll-behavior ; scrollBy() with default behavior 
24
FAIL Subframe with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
24
PASS Subframe with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Subframe with smooth scroll-behavior ; scrollBy() with instant behavior 
25
PASS Subframe with smooth scroll-behavior ; scrollBy() with instant behavior 
26
FAIL Subframe with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
26
PASS Subframe with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Subframe with auto scroll-behavior ; scrollIntoView() with default behavior 
27
PASS Subframe with auto scroll-behavior ; scrollIntoView() with default behavior 
28
PASS Subframe with auto scroll-behavior ; scrollIntoView() with auto behavior 
28
PASS Subframe with auto scroll-behavior ; scrollIntoView() with auto behavior 
29
PASS Subframe with auto scroll-behavior ; scrollIntoView() with instant behavior 
29
PASS Subframe with auto scroll-behavior ; scrollIntoView() with instant behavior 
30
FAIL Subframe with auto scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
30
PASS Subframe with auto scroll-behavior ; scrollIntoView() with smooth behavior 
31
FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
31
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with default behavior 
32
FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
32
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with auto behavior 
33
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with instant behavior 
33
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with instant behavior 
34
FAIL Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
34
PASS Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior 
35
PASS Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling 
35
PASS Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling 
36
PASS Aborting an ongoing smooth scrolling on a subframe with an instant scrolling 
36
PASS Aborting an ongoing smooth scrolling on a subframe with an instant scrolling 
37
37
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt -12 / +12 lines
Lines 3-29 PASS iframe loaded a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt_sec1
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
3
PASS Main frame with auto scroll-behavior ; scroll() with default behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
4
PASS Main frame with auto scroll-behavior ; scroll() with auto behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
5
PASS Main frame with auto scroll-behavior ; scroll() with instant behavior 
6
FAIL Main frame with auto scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
6
PASS Main frame with auto scroll-behavior ; scroll() with smooth behavior 
7
FAIL Main frame with smooth scroll-behavior ; scroll() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
7
PASS Main frame with smooth scroll-behavior ; scroll() with default behavior 
8
FAIL Main frame with smooth scroll-behavior ; scroll() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
8
PASS Main frame with smooth scroll-behavior ; scroll() with auto behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
9
PASS Main frame with smooth scroll-behavior ; scroll() with instant behavior 
10
FAIL Main frame with smooth scroll-behavior ; scroll() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
10
PASS Main frame with smooth scroll-behavior ; scroll() with smooth behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
11
PASS Main frame with auto scroll-behavior ; scrollTo() with default behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
12
PASS Main frame with auto scroll-behavior ; scrollTo() with auto behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
13
PASS Main frame with auto scroll-behavior ; scrollTo() with instant behavior 
14
FAIL Main frame with auto scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
14
PASS Main frame with auto scroll-behavior ; scrollTo() with smooth behavior 
15
FAIL Main frame with smooth scroll-behavior ; scrollTo() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
15
PASS Main frame with smooth scroll-behavior ; scrollTo() with default behavior 
16
FAIL Main frame with smooth scroll-behavior ; scrollTo() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
16
PASS Main frame with smooth scroll-behavior ; scrollTo() with auto behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
17
PASS Main frame with smooth scroll-behavior ; scrollTo() with instant behavior 
18
FAIL Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
18
PASS Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
19
PASS Main frame with auto scroll-behavior ; scrollBy() with default behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
20
PASS Main frame with auto scroll-behavior ; scrollBy() with auto behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
21
PASS Main frame with auto scroll-behavior ; scrollBy() with instant behavior 
22
FAIL Main frame with auto scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
22
PASS Main frame with auto scroll-behavior ; scrollBy() with smooth behavior 
23
FAIL Main frame with smooth scroll-behavior ; scrollBy() with default behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
23
PASS Main frame with smooth scroll-behavior ; scrollBy() with default behavior 
24
FAIL Main frame with smooth scroll-behavior ; scrollBy() with auto behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
24
PASS Main frame with smooth scroll-behavior ; scrollBy() with auto behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
25
PASS Main frame with smooth scroll-behavior ; scrollBy() with instant behavior 
26
FAIL Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior assert_less_than: Should not set scrollLeft immediately expected a number less than 500 but got 500
26
PASS Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
27
PASS Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
28
PASS Aborting an ongoing smooth scrolling on the main frame with an instant scrolling 
29
29
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html -1 / +1 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html_sec1
1
<!DOCTYPE html>
1
<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSOMViewSmoothScrollingEnabled=true ] -->
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
2
<title>Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on the root of a subframe</title>
3
<meta name="timeout" content="long"/>
3
<meta name="timeout" content="long"/>
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
4
<link rel="author" title="Frédéric Wang" href="mailto:fwang@igalia.com">
- a/LayoutTests/platform/mac-wk1/TestExpectations +7 lines
Lines 744-749 webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-s a/LayoutTests/platform/mac-wk1/TestExpectations_sec1
744
744
745
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
745
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
746
746
747
# Tests for smooth scroll behavior do not all work and they are slow, so let's just skip them.
748
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [ Skip ]
749
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [ Skip ]
750
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Skip ]
751
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Skip ]
752
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/inheritance.html [ Skip ]
753
747
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
754
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
748
755
749
webkit.org/b/189756 [ Mojave+ ] compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]
756
webkit.org/b/189756 [ Mojave+ ] compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]

Return to Bug 188043