这是indexloc提供的服务,不要输入任何密码
| Differences between
and this patch
- a/LayoutTests/ChangeLog +10 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
6
        Reviewed by NOBODY (OOPS!).
7
8
        * platform/mac-wk1/TestExpectations: Skip these tests on WK1 as they don't work for now and
9
        are slow anyway.
10
1
2019-09-27  Chris Dumez  <cdumez@apple.com>
11
2019-09-27  Chris Dumez  <cdumez@apple.com>
2
12
3
        Pages using WebGLRenderingContext fail to enter the back/forward cache
13
        Pages using WebGLRenderingContext fail to enter the back/forward cache
- a/LayoutTests/imported/w3c/ChangeLog +25 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
8
        Enable CSSOMViewSmoothScrollingEnabled on scroll behavior tests and update expectations.
9
10
        * web-platform-tests/css/cssom-view/scroll-behavior-default-css-expected.txt:
11
        * web-platform-tests/css/cssom-view/scroll-behavior-default-css.html:
12
        * web-platform-tests/css/cssom-view/scroll-behavior-element-expected.txt:
13
        * web-platform-tests/css/cssom-view/scroll-behavior-element.html:
14
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root-expected.txt:
15
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html:
16
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window-expected.txt:
17
        * web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html:
18
        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested-expected.txt:
19
        * web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html:
20
        * web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html:
21
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root-expected.txt:
22
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html:
23
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window-expected.txt:
24
        * web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html:
25
1
2019-09-26  Truitt Savell  <tsavell@apple.com>
26
2019-09-26  Truitt Savell  <tsavell@apple.com>
2
27
3
        Unreviewed, rolling out r250385.
28
        Unreviewed, rolling out r250385.
- 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 / +3 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
FAIL scrollIntoView with nested elements with different scroll-behavior assert_equals: Element with instant behavior should jump to the final position expected 0 but got 1000
3
4
assert_equals: Element with instant behavior should jump to the final position expected 500 but got 1000
3
5
- 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 +6 lines
Lines 730-735 webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-s a/LayoutTests/platform/mac-wk1/TestExpectations_sec1
730
730
731
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
731
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
732
732
733
# Tests for smooth scroll behavior do not all work and they are slow, so let's just skip them.
734
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [ Skip ]
735
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [ Skip ]
736
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Skip ]
737
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Skip ]
738
733
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
739
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
734
740
735
webkit.org/b/189756 [ Mojave+ ] compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]
741
webkit.org/b/189756 [ Mojave+ ] compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]
- a/Source/WebCore/CMakeLists.txt +2 lines
Lines 944-951 set(WebCore_NON_SVG_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec1
944
    page/ResizeObserverCallback.idl
944
    page/ResizeObserverCallback.idl
945
    page/ResizeObserverEntry.idl
945
    page/ResizeObserverEntry.idl
946
    page/Screen.idl
946
    page/Screen.idl
947
    page/ScrollBehavior.idl
947
    page/ScrollIntoViewOptions.idl
948
    page/ScrollIntoViewOptions.idl
948
    page/ScrollLogicalPosition.idl
949
    page/ScrollLogicalPosition.idl
950
    page/ScrollOptions.idl
949
    page/ScrollToOptions.idl
951
    page/ScrollToOptions.idl
950
    page/ShareData.idl
952
    page/ShareData.idl
951
    page/UndoItem.idl
953
    page/UndoItem.idl
- a/Source/WebCore/ChangeLog +145 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 relies on the existing ScrollAnimationSmooth.
16
17
        [1] https://drafts.csswg.org/cssom-view
18
        [2] https://drafts.csswg.org/cssom-view/#dictdef-scrolloptions
19
        [3] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
20
21
        Add support for ScrollOptions' ScrollBehavior and CSS scroll-behavior properties
22
23
        Tests: imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-default-css.html
24
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-element.html
25
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html
26
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html
27
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-scrollintoview-nested.html
28
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-smooth-positions.html
29
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html
30
               imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html
31
32
        * CMakeLists.txt: Add IDL files for ScrollOptions and ScrollBehavior.
33
        * DerivedSources.make: Ditto.
34
        * Sources.txt: Add ScrollBehavor and ScrollOptions implementation. Also build
35
        ScrollAnimationSmooth.cpp on all platforms.
36
        * Headers.cmake: Add headers for ScrollBehavor and ScrollOptions.
37
        * SourcesGTK.txt: Remove ScrollAnimationSmooth.cpp since it is built on all platforms now.
38
        * WebCore.xcodeproj/project.pbxproj: Add files to the build system.
39
        * css/CSSComputedStyleDeclaration.cpp: Handle scroll-behavior.
40
        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
41
        * css/CSSProperties.json: Add scroll-behavior.
42
        * css/CSSValueKeywords.in: Add keywords for scroll-behavior.
43
        * css/StyleBuilderConverter.h:
44
        (WebCore::StyleBuilderConverter::convertSmoothScrolling): New function to convert
45
        scroll-behavior into a "is smooth" boolean.
46
        * css/parser/CSSParserContext.cpp: Add runtime config for scroll-behavior.
47
        (WebCore::CSSParserContext::CSSParserContext):
48
        (WebCore::operator==):
49
        * css/parser/CSSParserContext.h: Ditto.
50
        (WebCore::CSSParserContextHash::hash):
51
        * css/parser/CSSParserFastPaths.cpp: Remove scroll-behavior templates. It is handled in the
52
        slow path since property can be disabled.
53
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
54
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
55
        * css/parser/CSSPropertyParser.cpp:
56
        (WebCore::CSSPropertyParser::parseSingleValue): Parse scroll-behavior (only if enabled).
57
        * dom/Element.cpp:
58
        (WebCore::Element::scrollIntoView): Pass scroll behavior, if any.
59
        (WebCore::Element::scrollBy): Use fromCoordinates helper function.
60
        (WebCore::Element::scrollTo): Handle the case when scroll behavior is smooth. Use
61
        fromCoordinates helper function.
62
        * page/DOMWindow.cpp:
63
        (WebCore::DOMWindow::scrollBy const): Use fromCoordinates helper function.
64
        (WebCore::DOMWindow::scrollTo const): Use fromCoordinates helper function. Handle the case
65
        when scroll behavior is smooth. The optimization when scroll position is (0, 0) is skipped
66
        when a scroll is in progress, otherwise such a scroll can't be cancelled by a follow-up
67
        scroll.
68
        * page/ScrollBehavior.cpp: Added.
69
        (WebCore::useSmoothScrolling): Helper funciton to determine the scroll behavior to apply to
70
        an element from the CSS and DOM behavior.
71
        * page/ScrollBehavior.h: Added.
72
        * page/ScrollBehavior.idl: Added.
73
        * page/ScrollIntoViewOptions.h: Make this class inherits from ScrollOption. Also remove
74
        unnecessary forward declaration.
75
        * page/ScrollIntoViewOptions.idl: Make this class inherits from ScrollOption.
76
        * page/ScrollOptions.h: Added.
77
        * page/ScrollOptions.idl: Added.
78
        * page/ScrollToOptions.h: Make this struct inherits from ScrollOptions.
79
        (WebCore::fromCoordinates): New helper function to generate a ScrollToOptions with undefined
80
        behavior. This is necessary to replace curly brace { x, y } declarations now that there is
81
        an extra behavior member from the parent class.
82
        (WebCore::normalizeNonFiniteCoordinatesOrFallBackTo): Copy the current ScrollToOptions so
83
        that the scroll behavior is preserved.
84
        * page/ScrollToOptions.idl: Make this class inherit from ScrollOptions.
85
        * page/Settings.yaml: New setting for CSSOM View smooth scrolling.
86
        * platform/ScrollAnimation.h:
87
        (WebCore::ScrollAnimation::scroll): Function to animate scrolling to a specified position.
88
        (WebCore::ScrollAnimation::isScrollInProgress const):
89
        * platform/ScrollAnimationKinetic.cpp:
90
        (WebCore::ScrollAnimationKinetic::isScrollInProgress const):
91
        * platform/ScrollAnimationKinetic.h:
92
        * platform/ScrollAnimationSmooth.cpp: Build this file on all platforms. Add a
93
        smoothFactorForProgrammaticScroll parameter to slow down the smooth scrolling.
94
        (WebCore::ScrollAnimationSmooth::scroll):
95
        (WebCore::ScrollAnimationSmooth::updatePerAxisData): Scale the time parameters of the
96
        animation so that it looks smoother.
97
        * platform/ScrollAnimationSmooth.h: Declare the class on all platforms.
98
        * platform/ScrollAnimator.cpp:
99
        (WebCore::ScrollAnimator::ScrollAnimator): Initialize animation member for programmatic scrolling.
100
        (WebCore::ScrollAnimator::isScrollInProgress const): For now, only claims scroll is in
101
        progress if smooth programmatic scroll is in progress.
102
        (WebCore::ScrollAnimator::scrollToOffset): Animate scrolling to the specified position.
103
        (WebCore::ScrollAnimator::cancelAnimations): Copy logic from ScrollAnimationSmooth.cpp.
104
        (WebCore::ScrollAnimator::serviceScrollAnimations): Ditto.
105
        (WebCore::ScrollAnimator::willEndLiveResize): Ditto.
106
        (WebCore::ScrollAnimator::didAddVerticalScrollbar): Ditto.
107
        (WebCore::ScrollAnimator::didAddHorizontalScrollbar): Ditto.
108
        * platform/ScrollAnimator.h: New animation member for smooth programmatic scrolling.
109
        * platform/ScrollAnimatorMac.mm:
110
        (WebCore::ScrollAnimatorMac::cancelAnimations): Call parent member to handle programmatic scrolling.
111
        * platform/ScrollView.cpp:
112
        (WebCore::ScrollView::setScrollPosition): Follow the CSSOM View spec: If a scroll is in
113
        progress, we interrupt it and continue the scroll call (even when we are at the final
114
        position).
115
        * platform/ScrollableArea.cpp:
116
        (WebCore::ScrollableArea::isScrollInProgress const): Helper function to check whether scroll
117
        is in progress on the animator. If m_scrollAnimator does not exist we don't construct it.
118
        (WebCore::ScrollableArea::scrollToOffsetWithAnimation):
119
        * platform/ScrollableArea.h:
120
        * rendering/RenderBox.cpp:
121
        (WebCore::RenderBox::scrollToPositionWithAnimation): Similar to setScrollTop/setScrollLeft
122
        but animate the scrolling.
123
        * rendering/RenderBox.h:
124
        * rendering/RenderLayer.cpp:
125
        (WebCore::RenderLayer::scrollToOffset): Follow the CSSOM View spec: If a scroll is in
126
        progress, we interrupt it and continue the scroll call (even when we are at the final
127
        position).
128
        (WebCore::RenderLayer::scrollToOffsetWithAnimation): Ditto. This is similar to scrollToOffset
129
        but animates the scroll.
130
        (WebCore::RenderLayer::scrollRectToVisible): Again don't do an early return if scroll is in
131
        progress. We call scrollToOffsetWithAnimation instead of scrollToOffset when appropriate.
132
        Note that this function may not work well for several nested scroll boxes with at least one
133
        element with smooth behavior. It will handled in bug Follow.
134
        * rendering/RenderLayer.h: Add scroll behavior to ScrollTectToVisibleOptions.
135
        * rendering/style/RenderStyle.h: Handle 'smooth scrolling' boolean data.
136
        (WebCore::RenderStyle::useSmoothScrolling const):
137
        (WebCore::RenderStyle::setUseSmoothScrolling):
138
        (WebCore::RenderStyle::initialUseSmoothScrolling):
139
        * rendering/style/StyleRareNonInheritedData.cpp: Ditto.
140
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
141
        (WebCore::StyleRareNonInheritedData::operator== const):
142
        * rendering/style/StyleRareNonInheritedData.h: Ditto.
143
        * testing/Internals.cpp:
144
        (WebCore::Internals::unconstrainedScrollTo): Use fromCoordinates helper function.
145
1
2019-09-27  Chris Dumez  <cdumez@apple.com>
146
2019-09-27  Chris Dumez  <cdumez@apple.com>
2
147
3
        Pages using WebGLRenderingContext fail to enter the back/forward cache
148
        Pages using WebGLRenderingContext fail to enter the back/forward cache
- a/Source/WebCore/DerivedSources.make +2 lines
Lines 892-899 JS_BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
892
    $(WebCore)/page/ResizeObserverCallback.idl \
892
    $(WebCore)/page/ResizeObserverCallback.idl \
893
    $(WebCore)/page/ResizeObserverEntry.idl \
893
    $(WebCore)/page/ResizeObserverEntry.idl \
894
    $(WebCore)/page/Screen.idl \
894
    $(WebCore)/page/Screen.idl \
895
    $(WebCore)/page/ScrollBehavior.idl \
895
    $(WebCore)/page/ScrollIntoViewOptions.idl \
896
    $(WebCore)/page/ScrollIntoViewOptions.idl \
896
    $(WebCore)/page/ScrollLogicalPosition.idl \
897
    $(WebCore)/page/ScrollLogicalPosition.idl \
898
    $(WebCore)/page/ScrollOptions.idl \
897
    $(WebCore)/page/ScrollToOptions.idl \
899
    $(WebCore)/page/ScrollToOptions.idl \
898
    $(WebCore)/page/ShareData.idl \
900
    $(WebCore)/page/ShareData.idl \
899
    $(WebCore)/page/UndoItem.idl \
901
    $(WebCore)/page/UndoItem.idl \
- a/Source/WebCore/Headers.cmake +2 lines
Lines 811-818 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec1
811
    page/RemoteFrame.h
811
    page/RemoteFrame.h
812
    page/RenderingUpdateScheduler.h
812
    page/RenderingUpdateScheduler.h
813
    page/RuntimeEnabledFeatures.h
813
    page/RuntimeEnabledFeatures.h
814
    page/ScrollBehavior.h
814
    page/ScrollIntoViewOptions.h
815
    page/ScrollIntoViewOptions.h
815
    page/ScrollLogicalPosition.h
816
    page/ScrollLogicalPosition.h
817
    page/ScrollOptions.h
816
    page/ScrollToOptions.h
818
    page/ScrollToOptions.h
817
    page/SecurityOrigin.h
819
    page/SecurityOrigin.h
818
    page/SecurityOriginData.h
820
    page/SecurityOriginData.h
- a/Source/WebCore/Sources.txt +4 lines
Lines 1623-1628 page/ResourceUsageOverlay.cpp a/Source/WebCore/Sources.txt_sec1
1623
page/ResourceUsageThread.cpp
1623
page/ResourceUsageThread.cpp
1624
page/RuntimeEnabledFeatures.cpp
1624
page/RuntimeEnabledFeatures.cpp
1625
page/Screen.cpp
1625
page/Screen.cpp
1626
page/ScrollBehavior.cpp
1626
page/SecurityOrigin.cpp
1627
page/SecurityOrigin.cpp
1627
page/SecurityOriginData.cpp
1628
page/SecurityOriginData.cpp
1628
page/SecurityPolicy.cpp
1629
page/SecurityPolicy.cpp
Lines 1726-1731 platform/RuntimeApplicationChecks.cpp a/Source/WebCore/Sources.txt_sec2
1726
platform/SSLKeyGenerator.cpp
1727
platform/SSLKeyGenerator.cpp
1727
platform/SchemeRegistry.cpp
1728
platform/SchemeRegistry.cpp
1728
platform/ScrollAnimator.cpp
1729
platform/ScrollAnimator.cpp
1730
platform/ScrollAnimationSmooth.cpp
1729
platform/ScrollView.cpp
1731
platform/ScrollView.cpp
1730
platform/ScrollableArea.cpp
1732
platform/ScrollableArea.cpp
1731
platform/Scrollbar.cpp
1733
platform/Scrollbar.cpp
Lines 3324-3331 JSSVGZoomEvent.cpp a/Source/WebCore/Sources.txt_sec3
3324
JSScreen.cpp
3326
JSScreen.cpp
3325
JSScreenLuminance.cpp
3327
JSScreenLuminance.cpp
3326
JSScriptProcessorNode.cpp
3328
JSScriptProcessorNode.cpp
3329
JSScrollBehavior.cpp
3327
JSScrollIntoViewOptions.cpp
3330
JSScrollIntoViewOptions.cpp
3328
JSScrollLogicalPosition.cpp
3331
JSScrollLogicalPosition.cpp
3332
JSScrollOptions.cpp
3329
JSScrollToOptions.cpp
3333
JSScrollToOptions.cpp
3330
JSSecurityPolicyViolationEvent.cpp
3334
JSSecurityPolicyViolationEvent.cpp
3331
JSServiceWorker.cpp
3335
JSServiceWorker.cpp
- a/Source/WebCore/SourcesGTK.txt -1 lines
Lines 61-67 page/scrolling/nicosia/ScrollingTreeStickyNode.cpp a/Source/WebCore/SourcesGTK.txt_sec1
61
page/scrolling/generic/ScrollingThreadGeneric.cpp
61
page/scrolling/generic/ScrollingThreadGeneric.cpp
62
62
63
platform/ScrollAnimationKinetic.cpp
63
platform/ScrollAnimationKinetic.cpp
64
platform/ScrollAnimationSmooth.cpp
65
platform/UserAgentQuirks.cpp
64
platform/UserAgentQuirks.cpp
66
65
67
platform/generic/ScrollAnimatorGeneric.cpp
66
platform/generic/ScrollAnimatorGeneric.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +26 lines
Lines 2365-2370 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
2365
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2365
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2366
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2366
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2367
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2367
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2368
		834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */; };
2369
		834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
2368
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2370
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2369
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2371
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2370
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
2372
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 2420-2425 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
2420
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2422
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2421
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2423
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2422
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2424
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2425
		83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356424 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
2426
		83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356435 /* ScrollOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2423
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2427
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2424
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2428
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2425
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
2429
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
Lines 10033-10041 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
10033
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10037
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10034
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10038
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10035
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10039
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10040
		8350C3E71DA59B6200356424 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
10041
		8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
10042
		8350C3E71DA59B6200356435 /* ScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollOptions.h; sourceTree = "<group>"; };
10036
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10043
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10037
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10044
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10038
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10045
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10046
		8350C3E81DA59B6200356424 /* ScrollBehavior.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollBehavior.idl; sourceTree = "<group>"; };
10047
		8350C3E81DA59B6200356435 /* ScrollOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollOptions.idl; sourceTree = "<group>"; };
10039
		8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
10048
		8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
10040
		83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
10049
		83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
10041
		835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
10050
		835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
Lines 10154-10162 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
10154
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10163
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10155
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10164
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10156
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10165
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10166
		83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollBehavior.cpp; sourceTree = "<group>"; };
10167
		83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollOptions.cpp; sourceTree = "<group>"; };
10157
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10168
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10158
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10169
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10159
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10170
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10171
		83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollBehavior.h; sourceTree = "<group>"; };
10172
		83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollOptions.h; sourceTree = "<group>"; };
10160
		83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
10173
		83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
10161
		83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
10174
		83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
10162
		83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
10175
		83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
Lines 20447-20456 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
20447
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20460
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20448
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20461
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20449
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20462
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20463
				8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */,
20464
				8350C3E71DA59B6200356424 /* ScrollBehavior.h */,
20465
				8350C3E81DA59B6200356424 /* ScrollBehavior.idl */,
20450
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20466
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20451
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20467
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20452
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20468
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20453
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20469
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20470
				8350C3E71DA59B6200356435 /* ScrollOptions.h */,
20471
				8350C3E81DA59B6200356435 /* ScrollOptions.idl */,
20454
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20472
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20455
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20473
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20456
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
20474
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
Lines 25204-25213 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
25204
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25222
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25205
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25223
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25206
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25224
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25225
				83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */,
25226
				83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */,
25207
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25227
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25208
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25228
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25209
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25229
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25210
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25230
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25231
				83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */,
25232
				83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */,
25211
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25233
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25212
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25234
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25213
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
25235
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
Lines 30388-30395 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
30388
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30410
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30389
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30411
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30390
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30412
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30413
				834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */,
30391
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30414
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30392
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30415
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30416
				834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */,
30393
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30417
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30394
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30418
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30395
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
30419
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
Lines 31568-31573 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
31568
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
31592
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
31569
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
31593
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
31570
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
31594
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
31595
				83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */,
31571
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
31596
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
31572
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
31597
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
31573
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
31598
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
Lines 31604-31609 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
31604
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
31629
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
31605
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
31630
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
31606
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
31631
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
31632
				83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */,
31607
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
31633
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
31608
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
31634
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
31609
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
31635
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
- a/Source/WebCore/bindings/js/JSDOMConvertRecord.h +1 lines
Lines 26-31 a/Source/WebCore/bindings/js/JSDOMConvertRecord.h_sec1
26
#pragma once
26
#pragma once
27
27
28
#include "IDLTypes.h"
28
#include "IDLTypes.h"
29
#include "JSDOMGlobalObject.h"
29
#include "JSDOMConvertStrings.h"
30
#include "JSDOMConvertStrings.h"
30
#include <JavaScriptCore/ObjectConstructor.h>
31
#include <JavaScriptCore/ObjectConstructor.h>
31
32
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +7 lines
Lines 434-439 static const CSSPropertyID computedProperties[] = { a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
434
#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
434
#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
435
    CSSPropertyWebkitOverflowScrolling,
435
    CSSPropertyWebkitOverflowScrolling,
436
#endif
436
#endif
437
    CSSPropertyScrollBehavior,
438
    CSSPropertyPerspective,
439
    CSSPropertyPerspectiveOrigin,
437
    CSSPropertyWebkitPrintColorAdjust,
440
    CSSPropertyWebkitPrintColorAdjust,
438
    CSSPropertyWebkitRtlOrdering,
441
    CSSPropertyWebkitRtlOrdering,
439
#if ENABLE(TOUCH_EVENTS)
442
#if ENABLE(TOUCH_EVENTS)
Lines 3718-3723 RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
3718
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3721
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3719
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3722
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3720
#endif
3723
#endif
3724
        case CSSPropertyScrollBehavior:
3725
            if (!style.useSmoothScrolling())
3726
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3727
            return cssValuePool.createIdentifierValue(CSSValueSmooth);
3721
        case CSSPropertyPerspective:
3728
        case CSSPropertyPerspective:
3722
            if (!style.hasPerspective())
3729
            if (!style.hasPerspective())
3723
                return cssValuePool.createIdentifierValue(CSSValueNone);
3730
                return cssValuePool.createIdentifierValue(CSSValueNone);
- a/Source/WebCore/css/CSSProperties.json +16 lines
Lines 6492-6497 a/Source/WebCore/css/CSSProperties.json_sec1
6492
                "url": "https://www.w3.org/TR/css-ui-4/#propdef-user-select"
6492
                "url": "https://www.w3.org/TR/css-ui-4/#propdef-user-select"
6493
            }
6493
            }
6494
        },
6494
        },
6495
        "scroll-behavior": {
6496
            "values": [
6497
                "auto",
6498
                "smooth"
6499
            ],
6500
            "codegen-properties": {
6501
                "converter": "SmoothScrolling",
6502
                "name-for-methods": "UseSmoothScrolling"
6503
            },
6504
            "status": {
6505
                "status": "experimental"
6506
            },
6507
            "specification": {
6508
                "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"
6509
            }
6510
        },
6495
        "scroll-padding": {
6511
        "scroll-padding": {
6496
            "codegen-properties": {
6512
            "codegen-properties": {
6497
                "enable-if": "ENABLE_CSS_SCROLL_SNAP",
6513
                "enable-if": "ENABLE_CSS_SCROLL_SNAP",
- a/Source/WebCore/css/CSSValueKeywords.in +4 lines
Lines 1384-1389 pan-y a/Source/WebCore/css/CSSValueKeywords.in_sec1
1384
pinch-zoom
1384
pinch-zoom
1385
#endif
1385
#endif
1386
1386
1387
// scroll-behavior
1388
// auto
1389
smooth
1390
1387
// hanging-punctuation
1391
// hanging-punctuation
1388
allow-end
1392
allow-end
1389
first
1393
first
- a/Source/WebCore/css/StyleBuilderConverter.h +6 lines
Lines 127-132 public: a/Source/WebCore/css/StyleBuilderConverter.h_sec1
127
#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
127
#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
128
    static bool convertOverflowScrolling(StyleResolver&, const CSSValue&);
128
    static bool convertOverflowScrolling(StyleResolver&, const CSSValue&);
129
#endif
129
#endif
130
    static bool convertSmoothScrolling(StyleResolver&, const CSSValue&);
130
    static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, const CSSValue&);
131
    static FontFeatureSettings convertFontFeatureSettings(StyleResolver&, const CSSValue&);
131
    static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
132
    static FontSelectionValue convertFontWeightFromValue(const CSSValue&);
132
    static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
133
    static FontSelectionValue convertFontStretchFromValue(const CSSValue&);
Lines 1404-1409 inline bool StyleBuilderConverter::convertOverflowScrolling(StyleResolver&, cons a/Source/WebCore/css/StyleBuilderConverter.h_sec2
1404
}
1405
}
1405
#endif
1406
#endif
1406
1407
1408
inline bool StyleBuilderConverter::convertSmoothScrolling(StyleResolver&, const CSSValue& value)
1409
{
1410
    return downcast<CSSPrimitiveValue>(value).valueID() == CSSValueSmooth;
1411
}
1412
1407
inline SVGLengthValue StyleBuilderConverter::convertSVGLengthValue(StyleResolver&, const CSSValue& value)
1413
inline SVGLengthValue StyleBuilderConverter::convertSVGLengthValue(StyleResolver&, const CSSValue& value)
1408
{
1414
{
1409
    return SVGLengthValue::fromCSSPrimitiveValue(downcast<CSSPrimitiveValue>(value));
1415
    return SVGLengthValue::fromCSSPrimitiveValue(downcast<CSSPrimitiveValue>(value));
- 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 61-66 public: a/Source/WebCore/css/parser/CSSParserContext.h_sec1
61
    bool attachmentEnabled { false };
61
    bool attachmentEnabled { false };
62
#endif
62
#endif
63
    bool deferredCSSParserEnabled { false };
63
    bool deferredCSSParserEnabled { false };
64
    bool scrollBehaviorEnabled { false };
64
    
65
    
65
    // This is only needed to support getMatchedCSSRules.
66
    // This is only needed to support getMatchedCSSRules.
66
    bool hasDocumentSecurityOrigin { false };
67
    bool hasDocumentSecurityOrigin { false };
Lines 112-118 struct CSSParserContextHash { a/Source/WebCore/css/parser/CSSParserContext.h_sec2
112
#if ENABLE(ATTACHMENT_ELEMENT)
113
#if ENABLE(ATTACHMENT_ELEMENT)
113
            & key.attachmentEnabled                         << 11
114
            & key.attachmentEnabled                         << 11
114
#endif
115
#endif
115
            & key.mode                                      << 12; // Keep this last.
116
            & key.scrollBehaviorEnabled                     << 12
117
            & key.mode                                      << 13; // Keep this last.
116
        hash ^= WTF::intHash(bits);
118
        hash ^= WTF::intHash(bits);
117
        return hash;
119
        return hash;
118
    }
120
    }
- a/Source/WebCore/css/parser/CSSParserFastPaths.cpp -5 lines
Lines 634-643 bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId a/Source/WebCore/css/parser/CSSParserFastPaths.cpp_sec1
634
            || valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
634
            || valueID == CSSValueSticky || valueID == CSSValueWebkitSticky;
635
    case CSSPropertyResize: // none | both | horizontal | vertical | auto
635
    case CSSPropertyResize: // none | both | horizontal | vertical | auto
636
        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
636
        return valueID == CSSValueNone || valueID == CSSValueBoth || valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto;
637
    // FIXME-NEWPARSER: Investigate this property.
638
    // case CSSPropertyScrollBehavior: // auto | smooth
639
    //     ASSERT(RuntimeEnabledFeatures::cssomSmoothScrollEnabled());
640
    //   return valueID == CSSValueAuto || valueID == CSSValueSmooth;
641
    case CSSPropertyShapeRendering:
637
    case CSSPropertyShapeRendering:
642
        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
638
        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
643
    case CSSPropertyStrokeLinejoin:
639
    case CSSPropertyStrokeLinejoin:
Lines 937-943 bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId) a/Source/WebCore/css/parser/CSSParserFastPaths.cpp_sec2
937
    // case CSSPropertyFontKerning:
933
    // case CSSPropertyFontKerning:
938
    // case CSSPropertyHyphens:
934
    // case CSSPropertyHyphens:
939
    // case CSSPropertyOverflowAnchor:
935
    // case CSSPropertyOverflowAnchor:
940
    // case CSSPropertyScrollBehavior:
941
    // case CSSPropertyScrollSnapType:
936
    // case CSSPropertyScrollSnapType:
942
    // case CSSPropertyTextAlignLast:
937
    // case CSSPropertyTextAlignLast:
943
    // case CSSPropertyTextCombineUpright:
938
    // 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 -10 / +61 lines
Lines 804-810 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec1
804
    bool insideFixed;
804
    bool insideFixed;
805
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
805
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
806
806
807
    // FIXME(webkit.org/b/188043): Support ScrollBehavior.
808
    ScrollIntoViewOptions options;
807
    ScrollIntoViewOptions options;
809
    if (arg) {
808
    if (arg) {
810
        auto value = arg.value();
809
        auto value = arg.value();
Lines 823-829 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec2
823
        SelectionRevealMode::Reveal,
822
        SelectionRevealMode::Reveal,
824
        isHorizontal ? alignX : alignY,
823
        isHorizontal ? alignX : alignY,
825
        isHorizontal ? alignY : alignX,
824
        isHorizontal ? alignY : alignX,
826
        ShouldAllowCrossOriginScrolling::No
825
        ShouldAllowCrossOriginScrolling::No,
826
        options.behavior.valueOr(ScrollBehavior::Auto)
827
    };
827
    };
828
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, visibleOptions);
828
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, visibleOptions);
829
}
829
}
Lines 884-890 void Element::scrollBy(const ScrollToOptions& options) a/Source/WebCore/dom/Element.cpp_sec3
884
884
885
void Element::scrollBy(double x, double y)
885
void Element::scrollBy(double x, double y)
886
{
886
{
887
    scrollBy({ x, y });
887
    scrollBy(fromCoordinates(x, y));
888
}
888
}
889
889
890
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
890
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
Lines 920-932 void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) a/Source/WebCore/dom/Element.cpp_sec4
920
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
920
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
921
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
921
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
922
    );
922
    );
923
    renderer->setScrollLeft(clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
923
    IntPoint scrollPosition(
924
    renderer->setScrollTop(clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
924
        clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()),
925
        clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom())
926
    );
927
    if (useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *this)) {
928
        renderer->scrollToPositionWithAnimation(scrollPosition, clamping);
929
        return;
930
    }
931
    renderer->setScrollLeft(scrollPosition.x(), ScrollType::Programmatic, clamping);
932
    renderer->setScrollTop(scrollPosition.y(), ScrollType::Programmatic, clamping);
933
#if ENABLE(ASYNC_SCROLLING)
934
    if (renderer->layer())
935
        renderer->layer()->setIsScrollInProgress(false);
936
#endif
925
}
937
}
926
938
927
void Element::scrollTo(double x, double y)
939
void Element::scrollTo(double x, double y)
928
{
940
{
929
    scrollTo({ x, y });
941
    scrollTo(fromCoordinates(x, y));
930
}
942
}
931
943
932
void Element::scrollByUnits(int units, ScrollGranularity granularity)
944
void Element::scrollByUnits(int units, ScrollGranularity granularity)
Lines 1236-1247 void Element::setScrollLeft(int newLeft) a/Source/WebCore/dom/Element.cpp_sec5
1236
    document().updateLayoutIgnorePendingStylesheets();
1248
    document().updateLayoutIgnorePendingStylesheets();
1237
1249
1238
    if (document().scrollingElement() == this) {
1250
    if (document().scrollingElement() == this) {
1239
        if (auto* frame = documentFrameWithNonNullView())
1251
        if (auto* frame = documentFrameWithNonNullView()) {
1240
            frame->view()->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), frame->view()->scrollY()));
1252
            // FIXME: Should we use document()->scrollingElement()?
1253
            // See https://github.com/w3c/csswg-drafts/issues/2977
1254
            if (document().documentElement() && useSmoothScrolling(ScrollBehavior::Auto, *document().documentElement())) {
1255
                auto window = makeRefPtr(document().domWindow());
1256
                if (!window)
1257
                    return;
1258
1259
                window->scrollTo(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor(), frame->view()->scrollY());
1260
            } else {
1261
                frame->view()->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor() * frame->frameScaleFactor()), frame->view()->scrollY()));
1262
            }
1263
        }
1241
        return;
1264
        return;
1242
    }
1265
    }
1243
1266
1244
    if (auto* renderer = renderBox()) {
1267
    if (auto* renderer = renderBox()) {
1268
        if (useSmoothScrolling(ScrollBehavior::Auto, *this)) {
1269
            IntPoint scrollPosition(
1270
                clampToInteger(newLeft * renderer->style().effectiveZoom()),
1271
                scrollTop()
1272
            );
1273
            renderer->scrollToPositionWithAnimation(scrollPosition, ScrollClamping::Clamped);
1274
            return;
1275
        }
1276
1245
        renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1277
        renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1246
        if (auto* scrollableArea = renderer->layer())
1278
        if (auto* scrollableArea = renderer->layer())
1247
            scrollableArea->setScrollShouldClearLatchedState(true);
1279
            scrollableArea->setScrollShouldClearLatchedState(true);
Lines 1253-1264 void Element::setScrollTop(int newTop) a/Source/WebCore/dom/Element.cpp_sec6
1253
    document().updateLayoutIgnorePendingStylesheets();
1285
    document().updateLayoutIgnorePendingStylesheets();
1254
1286
1255
    if (document().scrollingElement() == this) {
1287
    if (document().scrollingElement() == this) {
1256
        if (auto* frame = documentFrameWithNonNullView())
1288
        if (auto* frame = documentFrameWithNonNullView()) {
1257
            frame->view()->setScrollPosition(IntPoint(frame->view()->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor() * frame->frameScaleFactor())));
1289
            if (document().documentElement() && useSmoothScrolling(ScrollBehavior::Auto, *document().documentElement())) {
1290
                auto window = makeRefPtr(document().domWindow());
1291
                if (!window)
1292
                    return;
1293
1294
                window->scrollTo(frame->view()->scrollX(), newTop * frame->pageZoomFactor() * frame->frameScaleFactor());
1295
            } else {
1296
                frame->view()->setScrollPosition(IntPoint(frame->view()->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor() * frame->frameScaleFactor())));
1297
            }
1298
        }
1299
1258
        return;
1300
        return;
1259
    }
1301
    }
1260
1302
1261
    if (auto* renderer = renderBox()) {
1303
    if (auto* renderer = renderBox()) {
1304
        if (useSmoothScrolling(ScrollBehavior::Auto, *this)) {
1305
            IntPoint scrollPosition(
1306
                scrollLeft(),
1307
                clampToInteger(newTop * renderer->style().effectiveZoom())
1308
            );
1309
            renderer->scrollToPositionWithAnimation(scrollPosition, ScrollClamping::Clamped);
1310
            return;
1311
        }
1312
1262
        renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1313
        renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom()), ScrollType::Programmatic);
1263
        if (auto* scrollableArea = renderer->layer())
1314
        if (auto* scrollableArea = renderer->layer())
1264
            scrollableArea->setScrollShouldClearLatchedState(true);
1315
            scrollableArea->setScrollShouldClearLatchedState(true);
- a/Source/WebCore/page/DOMWindow.cpp -4 / +13 lines
Lines 1592-1598 double DOMWindow::devicePixelRatio() const a/Source/WebCore/page/DOMWindow.cpp_sec1
1592
1592
1593
void DOMWindow::scrollBy(double x, double y) const
1593
void DOMWindow::scrollBy(double x, double y) const
1594
{
1594
{
1595
    scrollBy({ x, y });
1595
    scrollBy(fromCoordinates(x, y));
1596
}
1596
}
1597
1597
1598
void DOMWindow::scrollBy(const ScrollToOptions& options) const
1598
void DOMWindow::scrollBy(const ScrollToOptions& options) const
Lines 1614-1623 void DOMWindow::scrollBy(const ScrollToOptions& options) const a/Source/WebCore/page/DOMWindow.cpp_sec2
1614
1614
1615
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1615
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1616
{
1616
{
1617
    scrollTo({ x, y }, clamping);
1617
    scrollTo(fromCoordinates(x, y), clamping);
1618
}
1618
}
1619
1619
1620
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const
1620
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) const
1621
{
1621
{
1622
    if (!isCurrentlyDisplayedInFrame())
1622
    if (!isCurrentlyDisplayedInFrame())
1623
        return;
1623
        return;
Lines 1630-1642 void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const a/Source/WebCore/page/DOMWindow.cpp_sec3
1630
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1630
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1631
    );
1631
    );
1632
1632
1633
    if (!scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1633
    if (!view->isScrollInProgress() && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1634
        return;
1634
        return;
1635
1635
1636
    document()->updateLayoutIgnorePendingStylesheets();
1636
    document()->updateLayoutIgnorePendingStylesheets();
1637
1637
1638
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1638
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1639
    // FIXME: Should we use document()->scrollingElement()?
1640
    // See https://github.com/w3c/csswg-drafts/issues/2977
1641
    if (document()->documentElement() && useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *document()->documentElement())) {
1642
        view->scrollToOffsetWithAnimation(layoutPos, clamping);
1643
        return;
1644
    }
1639
    view->setContentsScrollPosition(layoutPos);
1645
    view->setContentsScrollPosition(layoutPos);
1646
#if ENABLE(ASYNC_SCROLLING)
1647
    view->setIsScrollInProgress(false);
1648
#endif
1640
}
1649
}
1641
1650
1642
bool DOMWindow::allowedToChangeWindowGeometry() const
1651
bool DOMWindow::allowedToChangeWindowGeometry() const
- a/Source/WebCore/page/FrameView.cpp -2 / +2 lines
Lines 2560-2566 bool FrameView::isRubberBandInProgress() const a/Source/WebCore/page/FrameView.cpp_sec1
2560
    return false;
2560
    return false;
2561
}
2561
}
2562
2562
2563
bool FrameView::requestScrollPositionUpdate(const ScrollPosition& position)
2563
bool FrameView::requestScrollPositionUpdate(const ScrollPosition& position, bool withAnimation)
2564
{
2564
{
2565
    LOG_WITH_STREAM(Scrolling, stream << "FrameView::requestScrollPositionUpdate " << position);
2565
    LOG_WITH_STREAM(Scrolling, stream << "FrameView::requestScrollPositionUpdate " << position);
2566
2566
Lines 2572-2578 bool FrameView::requestScrollPositionUpdate(const ScrollPosition& position) a/Source/WebCore/page/FrameView.cpp_sec2
2572
#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
2572
#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
2573
    if (Page* page = frame().page()) {
2573
    if (Page* page = frame().page()) {
2574
        if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
2574
        if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
2575
            return scrollingCoordinator->requestScrollPositionUpdate(*this, position);
2575
            return scrollingCoordinator->requestScrollPositionUpdate(*this, position, withAnimation);
2576
    }
2576
    }
2577
#else
2577
#else
2578
    UNUSED_PARAM(position);
2578
    UNUSED_PARAM(position);
- a/Source/WebCore/page/FrameView.h -1 / +1 lines
Lines 228-234 public: a/Source/WebCore/page/FrameView.h_sec1
228
    void scrollToFocusedElementImmediatelyIfNeeded();
228
    void scrollToFocusedElementImmediatelyIfNeeded();
229
    void updateLayerPositionsAfterScrolling() final;
229
    void updateLayerPositionsAfterScrolling() final;
230
    void updateCompositingLayersAfterScrolling() final;
230
    void updateCompositingLayersAfterScrolling() final;
231
    bool requestScrollPositionUpdate(const ScrollPosition&) final;
231
    bool requestScrollPositionUpdate(const ScrollPosition&, bool /*withAnimation*/ = false) final;
232
    bool isRubberBandInProgress() const final;
232
    bool isRubberBandInProgress() const final;
233
    WEBCORE_EXPORT ScrollPosition minimumScrollPosition() const final;
233
    WEBCORE_EXPORT ScrollPosition minimumScrollPosition() const final;
234
    WEBCORE_EXPORT ScrollPosition maximumScrollPosition() const final;
234
    WEBCORE_EXPORT ScrollPosition maximumScrollPosition() const final;
- a/Source/WebCore/page/ScrollBehavior.cpp +48 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.cpp_sec1
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#include "config.h"
21
#include "ScrollBehavior.h"
22
23
#include "Element.h"
24
#include "RenderElement.h"
25
#include "RenderStyle.h"
26
#include "Settings.h"
27
28
namespace WebCore {
29
30
bool useSmoothScrolling(ScrollBehavior behavior, Element& associatedElement)
31
{
32
    if (!associatedElement.document().settings().CSSOMViewSmoothScrollingEnabled() || !associatedElement.renderer())
33
        return false;
34
35
    // https://drafts.csswg.org/cssom-view/#scrolling
36
    switch (behavior) {
37
    case ScrollBehavior::Auto:
38
        return associatedElement.renderer()->style().useSmoothScrolling();
39
    case ScrollBehavior::Instant:
40
        return false;
41
    case ScrollBehavior::Smooth:
42
        return true;
43
    }
44
    ASSERT_NOT_REACHED();
45
    return false;
46
}
47
48
} // namespace WebCore
- a/Source/WebCore/page/ScrollBehavior.h +34 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.h_sec1
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#pragma once
21
22
namespace WebCore {
23
24
class Element;
25
26
enum class ScrollBehavior : uint8_t {
27
    Auto = 0,
28
    Instant,
29
    Smooth
30
};
31
32
bool useSmoothScrolling(ScrollBehavior, Element& associatedElement);
33
34
} // namespace WebCore
- a/Source/WebCore/page/ScrollBehavior.idl +20 lines
Line 0 a/Source/WebCore/page/ScrollBehavior.idl_sec1
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
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 -2 / +1 lines
Lines 17-24 a/Source/WebCore/page/ScrollIntoViewOptions.idl_sec1
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
 */
18
 */
19
19
20
// FIXME(webkit.org/b/188043): Support ScrollBehavior.
20
dictionary ScrollIntoViewOptions : ScrollOptions {
21
dictionary ScrollIntoViewOptions {
22
    [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
21
    [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start";
23
    [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
22
    [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest";
24
};
23
};
- a/Source/WebCore/page/ScrollOptions.h +30 lines
Line 0 a/Source/WebCore/page/ScrollOptions.h_sec1
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#pragma once
21
22
#include "ScrollBehavior.h"
23
24
namespace WebCore {
25
26
struct ScrollOptions {
27
    Optional<ScrollBehavior> behavior { ScrollBehavior::Auto };
28
};
29
30
} // namespace WebCore
- a/Source/WebCore/page/ScrollOptions.idl +22 lines
Line 0 a/Source/WebCore/page/ScrollOptions.idl_sec1
1
/*
2
 * Copyright (C) 2018 Igalia S.L.
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
dictionary ScrollOptions {
21
    ScrollBehavior behavior = "auto";
22
};
- a/Source/WebCore/page/ScrollToOptions.h -2 / +11 lines
Lines 28-43 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;
39
};
40
};
40
41
42
inline ScrollToOptions fromCoordinates(double x, double y)
43
{
44
    ScrollToOptions options;
45
    options.left = x;
46
    options.top = y;
47
    return options;
48
};
49
41
inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue)
50
inline double normalizeNonFiniteValueOrFallBackTo(Optional<double> value, double fallbackValue)
42
{
51
{
43
    // Normalize non-finite values (https://drafts.csswg.org/cssom-view/#normalize-non-finite-values).
52
    // Normalize non-finite values (https://drafts.csswg.org/cssom-view/#normalize-non-finite-values).
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.
56
// 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)
57
inline ScrollToOptions normalizeNonFiniteCoordinatesOrFallBackTo(const ScrollToOptions& value, double x, double y)
49
{
58
{
50
    ScrollToOptions options;
59
    ScrollToOptions options = value;
51
    options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
60
    options.left = normalizeNonFiniteValueOrFallBackTo(value.left, x);
52
    options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
61
    options.top = normalizeNonFiniteValueOrFallBackTo(value.top, y);
53
    return options;
62
    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 602-607 syntheticEditingCommandsEnabled: a/Source/WebCore/page/Settings.yaml_sec1
602
CSSOMViewScrollingAPIEnabled:
602
CSSOMViewScrollingAPIEnabled:
603
  initial: false
603
  initial: false
604
604
605
CSSOMViewSmoothScrollingEnabled:
606
  initial: false
607
605
inputEventsEnabled:
608
inputEventsEnabled:
606
  initial: true
609
  initial: true
607
610
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp -3 / +24 lines
Lines 230-236 void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView& frameView a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec1
230
    node->setHorizontalScrollbarLayer(frameView.layerForHorizontalScrollbar());
230
    node->setHorizontalScrollbarLayer(frameView.layerForHorizontalScrollbar());
231
}
231
}
232
232
233
bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scrollableArea, const IntPoint& scrollPosition)
233
bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scrollableArea, const IntPoint& scrollPosition, bool withAnimation)
234
{
234
{
235
    ASSERT(isMainThread());
235
    ASSERT(isMainThread());
236
    ASSERT(m_page);
236
    ASSERT(m_page);
Lines 248-254 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scro a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec2
248
248
249
    bool inPageCache = frameView->frame().document()->pageCacheState() != Document::NotInPageCache;
249
    bool inPageCache = frameView->frame().document()->pageCacheState() != Document::NotInPageCache;
250
    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
250
    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
251
    if (inProgrammaticScroll || inPageCache)
251
    if (!withAnimation && (inProgrammaticScroll || inPageCache))
252
        updateScrollPositionAfterAsyncScroll(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
252
        updateScrollPositionAfterAsyncScroll(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
253
253
254
    // If this frame view's document is being put into the page cache, we don't want to update our
254
    // If this frame view's document is being put into the page cache, we don't want to update our
Lines 260-266 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scro a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec3
260
    if (!stateNode)
260
    if (!stateNode)
261
        return false;
261
        return false;
262
262
263
    stateNode->setRequestedScrollPosition(scrollPosition, inProgrammaticScroll);
263
    stateNode->setRequestedScrollPosition(scrollPosition, inProgrammaticScroll, withAnimation);
264
    return true;
264
    return true;
265
}
265
}
266
266
Lines 291-296 void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(Scr a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec4
291
    m_updateNodeScrollPositionTimer.startOneShot(0_s);
291
    m_updateNodeScrollPositionTimer.startOneShot(0_s);
292
}
292
}
293
293
294
void AsyncScrollingCoordinator::setScrollAnimationInProgress(ScrollingNodeID nodeID, bool isScrollAnimationInProgress)
295
{
296
    ASSERT(isMainThread());
297
298
    if (!m_page)
299
        return;
300
301
    auto* frameView = frameViewForScrollingNode(nodeID);
302
    if (!frameView)
303
        return;
304
305
    if (nodeID == frameView->scrollingNodeID()) {
306
        frameView->setIsScrollInProgress(isScrollAnimationInProgress);
307
        return;
308
    }
309
310
    // Overflow-scroll area.
311
    if (auto* scrollableArea = frameView->scrollableAreaForScrollLayerID(nodeID))
312
        scrollableArea->setIsScrollInProgress(isScrollAnimationInProgress);
313
}
314
294
void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired()
315
void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired()
295
{
316
{
296
    updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.layoutViewportOrigin, ScrollType::User, m_scheduledScrollUpdate.updateLayerPositionAction);
317
    updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.layoutViewportOrigin, ScrollType::User, m_scheduledScrollUpdate.updateLayerPositionAction);
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h -1 / +3 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 deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const;
60
    void deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) const;
Lines 98-104 private: a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h_sec2
98
    WEBCORE_EXPORT void frameViewVisualViewportChanged(FrameView&) override;
100
    WEBCORE_EXPORT void frameViewVisualViewportChanged(FrameView&) override;
99
    WEBCORE_EXPORT void frameViewEventTrackingRegionsChanged(FrameView&) override;
101
    WEBCORE_EXPORT void frameViewEventTrackingRegionsChanged(FrameView&) override;
100
102
101
    WEBCORE_EXPORT bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&) override;
103
    WEBCORE_EXPORT bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&, bool withAnimation = false) override;
102
104
103
    WEBCORE_EXPORT void applyScrollingTreeLayerPositions() override;
105
    WEBCORE_EXPORT void applyScrollingTreeLayerPositions() override;
104
106
- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h -1 / +1 lines
Lines 121-127 public: a/Source/WebCore/page/scrolling/ScrollingCoordinator.h_sec1
121
121
122
    // These virtual functions are currently unique to the threaded scrolling architecture. 
122
    // These virtual functions are currently unique to the threaded scrolling architecture. 
123
    virtual void commitTreeStateIfNeeded() { }
123
    virtual void commitTreeStateIfNeeded() { }
124
    virtual bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&) { return false; }
124
    virtual bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&, bool /*withAnimation*/ = false) { return false; }
125
    virtual ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return ScrollingEventResult::DidNotHandleEvent; }
125
    virtual ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return ScrollingEventResult::DidNotHandleEvent; }
126
126
127
    // Create an unparented node.
127
    // Create an unparented node.
- 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_expectsWheelEventTestTrigger(stateNode.expectsWheelEventTestTrigger())
60
    , m_expectsWheelEventTestTrigger(stateNode.expectsWheelEventTestTrigger())
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 expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; }
117
    bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; }
117
    WEBCORE_EXPORT void setExpectsWheelEventTestTrigger(bool);
118
    WEBCORE_EXPORT void setExpectsWheelEventTestTrigger(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_expectsWheelEventTestTrigger { false };
176
    bool m_expectsWheelEventTestTrigger { false };
175
};
177
};
176
178
- a/Source/WebCore/page/scrolling/ScrollingTree.h +3 lines
Lines 85-90 public: a/Source/WebCore/page/scrolling/ScrollingTree.h_sec1
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*/) { }
87
87
88
    // Called for scroll animation status updates.
89
    virtual void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool /*isScrollAnimationInProgress*/) { }
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);
90
93
- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp -2 / +11 lines
Lines 162-172 void ScrollingTreeScrollingNode::scrollBy(const FloatSize& delta, ScrollPosition a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec1
162
    scrollTo(currentScrollPosition() + delta, ScrollType::User, clamp);
162
    scrollTo(currentScrollPosition() + delta, ScrollType::User, clamp);
163
}
163
}
164
164
165
void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType scrollType, ScrollPositionClamp clamp)
165
void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType scrollType, ScrollPositionClamp clamp, bool needSyncBack)
166
{
166
{
167
    if (position == m_currentScrollPosition)
167
    if (position == m_currentScrollPosition) {
168
        if (requestScrollWithAnimation() && needSyncBack)
169
            scrollingTree().scrollingTreeNodeDidScroll(*this, ScrollingLayerPositionAction::Sync);
170
        scrollingTree().scrollingTreeNodeIsScrollAnimationInProgressDidChange(scrollingNodeID(), false);
171
        setRequestScrollWithAnimation(false);
168
        return;
172
        return;
173
    }
169
174
175
    if (scrollAnimationInProgress())
176
        setStopScrollAnimation(true);
170
    scrollingTree().setIsHandlingProgrammaticScroll(scrollType == ScrollType::Programmatic);
177
    scrollingTree().setIsHandlingProgrammaticScroll(scrollType == ScrollType::Programmatic);
171
    
178
    
172
    m_currentScrollPosition = adjustedScrollPosition(position, clamp);
179
    m_currentScrollPosition = adjustedScrollPosition(position, clamp);
Lines 176-181 void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp_sec2
176
    updateViewportForCurrentScrollPosition();
183
    updateViewportForCurrentScrollPosition();
177
    currentScrollPositionChanged();
184
    currentScrollPositionChanged();
178
185
186
    setStopScrollAnimation(false);
187
    setRequestScrollWithAnimation(false);
179
    scrollingTree().setIsHandlingProgrammaticScroll(false);
188
    scrollingTree().setIsHandlingProgrammaticScroll(false);
180
}
189
}
181
190
- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h -1 / +13 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 needSnycBack = 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 92-97 public: a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h_sec2
92
    CALayer *scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
92
    CALayer *scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
93
    CALayer *scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
93
    CALayer *scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
94
#endif
94
#endif
95
    void setRequestScrollWithAnimation(bool withAnimation) { m_requestScrollWithAnimation = withAnimation; }
96
    bool requestScrollWithAnimation() const { return m_requestScrollWithAnimation; }
97
98
    void setScrollAnimationInProgress(bool inProgress) { m_scrollAnimationInProgress = inProgress; }
99
    bool scrollAnimationInProgress() const { return m_scrollAnimationInProgress; }
100
101
    void setStopScrollAnimation(bool stop) { m_stopScrollAnimation = stop; }
102
    bool stopScrollAnimation() const { return m_stopScrollAnimation; }
95
103
96
protected:
104
protected:
97
    ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
105
    ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
Lines 152-157 private: a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h_sec3
152
    ScrollableAreaParameters m_scrollableAreaParameters;
160
    ScrollableAreaParameters m_scrollableAreaParameters;
153
    bool m_expectsWheelEventTestTrigger { false };
161
    bool m_expectsWheelEventTestTrigger { false };
154
    bool m_isFirstCommit { true };
162
    bool m_isFirstCommit { true };
163
    bool m_requestScrollWithAnimation { false };
164
    bool m_scrollAnimationInProgress { false };
165
    bool m_stopScrollAnimation { false };
166
    bool m_forceScrollPositionSyncBack { false };
155
167
156
#if PLATFORM(COCOA)
168
#if PLATFORM(COCOA)
157
    RetainPtr<CALayer> m_scrollContainerLayer;
169
    RetainPtr<CALayer> m_scrollContainerLayer;
- 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&, ScrollClamping) { };
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 / +21 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, ScrollClamping)
70
{
71
    // FIXME: Consider clamping?
72
    ScrollGranularity granularity = ScrollByPage;
73
    bool needToScroll = updatePerAxisData(m_horizontalData, granularity, position.x() - m_horizontalData.currentPosition, m_scrollableArea.minimumScrollPosition().x(), m_scrollableArea.maximumScrollPosition().x(), smoothFactorForProgrammaticScroll);
74
    needToScroll |=
75
        updatePerAxisData(m_verticalData, granularity, position.y() - m_verticalData.currentPosition, m_scrollableArea.minimumScrollPosition().y(), m_scrollableArea.maximumScrollPosition().y(), smoothFactorForProgrammaticScroll);
76
    if (needToScroll && !animationTimerActive()) {
77
        m_startTime = m_horizontalData.startTime;
78
        animationTimerFired();
79
    }
80
};
81
70
void ScrollAnimationSmooth::stop()
82
void ScrollAnimationSmooth::stop()
71
{
83
{
72
    m_animationTimer.stop();
84
    m_animationTimer.stop();
Lines 247-253 static inline void getAnimationParametersForGranularity(ScrollGranularity granul a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec4
247
    }
259
    }
248
}
260
}
249
261
250
bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranularity granularity, float delta, float minScrollPosition, float maxScrollPosition)
262
bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranularity granularity, float delta, float minScrollPosition, float maxScrollPosition, double smoothFactor)
251
{
263
{
252
    if (!data.startTime || !delta || (delta < 0) != (data.desiredPosition - data.currentPosition < 0)) {
264
    if (!data.startTime || !delta || (delta < 0) != (data.desiredPosition - data.currentPosition < 0)) {
253
        data.desiredPosition = data.currentPosition;
265
        data.desiredPosition = data.currentPosition;
Lines 264-269 bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec5
264
    Curve coastTimeCurve;
276
    Curve coastTimeCurve;
265
    getAnimationParametersForGranularity(granularity, animationTime, repeatMinimumSustainTime, attackTime, releaseTime, coastTimeCurve, maximumCoastTime);
277
    getAnimationParametersForGranularity(granularity, animationTime, repeatMinimumSustainTime, attackTime, releaseTime, coastTimeCurve, maximumCoastTime);
266
278
279
    animationTime *= smoothFactor;
280
    repeatMinimumSustainTime *= smoothFactor;
281
    attackTime *= smoothFactor;
282
    releaseTime *= smoothFactor;
283
    maximumCoastTime *= smoothFactor;
284
267
    data.desiredPosition = newPosition;
285
    data.desiredPosition = newPosition;
268
    if (!data.startTime)
286
    if (!data.startTime)
269
        data.attackTime = attackTime;
287
        data.attackTime = attackTime;
Lines 407-411 bool ScrollAnimationSmooth::animationTimerActive() const a/Source/WebCore/platform/ScrollAnimationSmooth.cpp_sec6
407
}
425
}
408
426
409
} // namespace WebCore
427
} // 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&, ScrollClamping) 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 +53 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(std::make_unique<ScrollAnimationSmooth>(scrollableArea, m_currentPosition, [this](FloatPoint&& position) {
57
        if (m_scrollableArea.requestScrollPositionUpdate(roundedIntPoint(position)))
58
            return;
59
        FloatSize delta = position - m_currentPosition;
60
        m_currentPosition = WTFMove(position);
61
        notifyPositionChanged(delta);
62
    }))
55
{
63
{
56
}
64
}
57
65
58
ScrollAnimator::~ScrollAnimator() = default;
66
ScrollAnimator::~ScrollAnimator() = default;
59
67
68
bool ScrollAnimator::isScrollInProgress() const
69
{
70
    // FIXME (TODO): This should also take into account animations in derived classes.
71
    return m_animationProgrammaticScroll->isScrollInProgress();
72
}
73
60
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
74
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
61
{
75
{
62
    FloatPoint currentPosition = this->currentPosition();
76
    FloatPoint currentPosition = this->currentPosition();
Lines 70-80 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, a/Source/WebCore/platform/ScrollAnimator.cpp_sec3
70
    if (currentPosition == newPosition)
84
    if (currentPosition == newPosition)
71
        return false;
85
        return false;
72
86
87
    if (m_scrollableArea.requestScrollPositionUpdate(roundedIntPoint(newPosition)))
88
        return true;
89
73
    m_currentPosition = newPosition;
90
    m_currentPosition = newPosition;
74
    notifyPositionChanged(newPosition - currentPosition);
91
    notifyPositionChanged(newPosition - currentPosition);
75
    return true;
92
    return true;
76
}
93
}
77
94
95
void ScrollAnimator::scrollToOffset(const FloatPoint& offset, ScrollClamping clamping)
96
{
97
    m_animationProgrammaticScroll->setCurrentPosition(m_currentPosition);
98
    auto newPosition = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
99
    m_animationProgrammaticScroll->scroll(newPosition, clamping);
100
}
101
78
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
102
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
79
{
103
{
80
    FloatPoint newPositon = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
104
    FloatPoint newPositon = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
Lines 245-248 void ScrollAnimator::removeTestDeferralForReason(WheelEventTestTrigger::Scrollab a/Source/WebCore/platform/ScrollAnimator.cpp_sec4
245
}
269
}
246
#endif
270
#endif
247
271
272
void ScrollAnimator::cancelAnimations()
273
{
274
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
275
    m_animationProgrammaticScroll->stop();
276
#endif
277
}
278
279
void ScrollAnimator::serviceScrollAnimations()
280
{
281
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
282
    m_animationProgrammaticScroll->serviceAnimation();
283
#endif
284
}
285
286
void ScrollAnimator::willEndLiveResize()
287
{
288
    m_animationProgrammaticScroll->updateVisibleLengths();
289
}
290
291
void ScrollAnimator::didAddVerticalScrollbar(Scrollbar*)
292
{
293
    m_animationProgrammaticScroll->updateVisibleLengths();
294
}
295
296
void ScrollAnimator::didAddHorizontalScrollbar(Scrollbar*)
297
{
298
    m_animationProgrammaticScroll->updateVisibleLengths();
299
}
300
248
} // namespace WebCore
301
} // 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 WheelEventTestTrigger;
52
class WheelEventTestTrigger;
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&, ScrollClamping = ScrollClamping::Clamped);
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 setWheelEventTestTrigger(RefPtr<WheelEventTestTrigger>&& testTrigger) { m_wheelEventTestTrigger = testTrigger; }
127
    void setWheelEventTestTrigger(RefPtr<WheelEventTestTrigger>&& testTrigger) { m_wheelEventTestTrigger = testTrigger; }
125
#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
128
#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
Lines 150-155 protected: a/Source/WebCore/platform/ScrollAnimator.h_sec6
150
    ScrollController m_scrollController;
153
    ScrollController m_scrollController;
151
#endif
154
#endif
152
    FloatPoint m_currentPosition;
155
    FloatPoint m_currentPosition;
156
157
    std::unique_ptr<ScrollAnimation> m_animationProgrammaticScroll;
153
};
158
};
154
159
155
} // namespace WebCore
160
} // namespace WebCore
- a/Source/WebCore/platform/ScrollView.cpp -1 / +5 lines
Lines 475-483 void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition) a/Source/WebCore/platform/ScrollView.cpp_sec1
475
475
476
    ScrollPosition newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
476
    ScrollPosition newScrollPosition = !delegatesScrolling() ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
477
477
478
    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && newScrollPosition == this->scrollPosition())
478
    bool scrollInProgress = isScrollInProgress();
479
    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && !scrollInProgress && newScrollPosition == this->scrollPosition())
479
        return;
480
        return;
480
481
482
    if (scrollInProgress)
483
        scrollAnimator().cancelAnimations();
484
481
    if (requestScrollPositionUpdate(newScrollPosition))
485
    if (requestScrollPositionUpdate(newScrollPosition))
482
        return;
486
        return;
483
487
- a/Source/WebCore/platform/ScrollableArea.cpp -3 / +20 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 ENABLE(ASYNC_SCROLLING)
75
    , m_isScrollInProgress(false)
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() const
111
{
112
#if ENABLE(ASYNC_SCROLLING)
113
    return m_isScrollInProgress || scrollAnimator().isScrollInProgress();
114
#endif
115
    return m_scrollAnimator && scrollAnimator().isScrollInProgress();
116
}
117
107
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
118
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
108
{
119
{
109
    ScrollbarOrientation orientation;
120
    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);
153
    return scrollAnimator().scroll(orientation, granularity, step, multiplier);
143
}
154
}
144
155
156
void ScrollableArea::scrollToOffsetWithAnimation(const FloatPoint& offset, ScrollClamping clamping)
157
{
158
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffset " << offset);
159
    scrollAnimator().scrollToOffset(offset, clamping);
160
}
161
145
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
162
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
146
{
163
{
147
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
164
    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.
238
// NOTE: Only called from Internals for testing.
222
void ScrollableArea::setScrollOffsetFromInternals(const ScrollOffset& offset)
239
void ScrollableArea::setScrollOffsetFromInternals(const ScrollOffset& offset)
223
{
240
{
241
    ScrollPosition position = scrollPositionFromOffset(offset);
242
    if (requestScrollPositionUpdate(position))
243
        return;
224
    setScrollOffsetFromAnimation(offset);
244
    setScrollOffsetFromAnimation(offset);
225
}
245
}
226
246
227
void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset)
247
void ScrollableArea::setScrollOffsetFromAnimation(const ScrollOffset& offset)
228
{
248
{
229
    ScrollPosition position = scrollPositionFromOffset(offset);
249
    ScrollPosition position = scrollPositionFromOffset(offset);
230
    if (requestScrollPositionUpdate(position))
231
        return;
232
233
    scrollPositionChanged(position);
250
    scrollPositionChanged(position);
234
}
251
}
235
252
- a/Source/WebCore/platform/ScrollableArea.h -1 / +10 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() const;
66
#if ENABLE(ASYNC_SCROLLING)
67
    void setIsScrollInProgress(bool isScrollInProgress) { m_isScrollInProgress = isScrollInProgress; }
68
#endif
65
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
69
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
70
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
66
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
71
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
67
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
72
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
68
73
Lines 73-79 public: a/Source/WebCore/platform/ScrollableArea.h_sec2
73
    // Allows subclasses to handle scroll position updates themselves. If this member function
78
    // Allows subclasses to handle scroll position updates themselves. If this member function
74
    // returns true, the scrollable area won't actually update the scroll position and instead
79
    // returns true, the scrollable area won't actually update the scroll position and instead
75
    // expect it to happen sometime in the future.
80
    // expect it to happen sometime in the future.
76
    virtual bool requestScrollPositionUpdate(const ScrollPosition&) { return false; }
81
    virtual bool requestScrollPositionUpdate(const ScrollPosition&, bool /*withAnimation*/ = false) { return false; }
77
82
78
    WEBCORE_EXPORT bool handleWheelEvent(const PlatformWheelEvent&);
83
    WEBCORE_EXPORT bool handleWheelEvent(const PlatformWheelEvent&);
79
84
Lines 403-408 private: a/Source/WebCore/platform/ScrollableArea.h_sec3
403
    unsigned m_scrollOriginChanged : 1;
408
    unsigned m_scrollOriginChanged : 1;
404
    unsigned m_currentScrollType : 1; // ScrollType
409
    unsigned m_currentScrollType : 1; // ScrollType
405
    unsigned m_scrollShouldClearLatchedState : 1;
410
    unsigned m_scrollShouldClearLatchedState : 1;
411
#if ENABLE(ASYNC_SCROLLING)
412
    unsigned m_isScrollInProgress : 1;
413
#endif
414
406
};
415
};
407
416
408
} // namespace WebCore
417
} // 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 +11 lines
Lines 591-596 void RenderBox::setScrollTop(int newTop, ScrollType scrollType, ScrollClamping c a/Source/WebCore/rendering/RenderBox.cpp_sec1
591
    layer()->scrollToYPosition(newTop, scrollType, clamping);
591
    layer()->scrollToYPosition(newTop, scrollType, clamping);
592
}
592
}
593
593
594
void RenderBox::scrollToPositionWithAnimation(ScrollPosition scrollPosition, ScrollClamping clamping)
595
{
596
    if (!hasOverflowClip() || !layer())
597
        return;
598
    setupWheelEventTestTrigger(*layer());
599
    auto previousScrollType = layer()->currentScrollType();
600
    layer()->setCurrentScrollType(ScrollType::Programmatic);
601
    layer()->scrollToOffsetWithAnimation(scrollPosition, clamping);
602
    layer()->setCurrentScrollType(previousScrollType);
603
}
604
594
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
605
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
595
{
606
{
596
    rects.append(snappedIntRect(accumulatedOffset, size()));
607
    rects.append(snappedIntRect(accumulatedOffset, size()));
- a/Source/WebCore/rendering/RenderBox.h +1 lines
Lines 249-254 public: a/Source/WebCore/rendering/RenderBox.h_sec1
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, ScrollClamping = ScrollClamping::Clamped);
251
    virtual void setScrollTop(int, ScrollType, ScrollClamping = ScrollClamping::Clamped);
251
    virtual void setScrollTop(int, ScrollType, ScrollClamping = ScrollClamping::Clamped);
252
    void scrollToPositionWithAnimation(ScrollPosition, 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 -10 / +61 lines
Lines 115-120 a/Source/WebCore/rendering/RenderLayer.cpp_sec1
115
#include "ScaleTransformOperation.h"
115
#include "ScaleTransformOperation.h"
116
#include "ScriptDisallowedScope.h"
116
#include "ScriptDisallowedScope.h"
117
#include "ScrollAnimator.h"
117
#include "ScrollAnimator.h"
118
#include "ScrollBehavior.h"
118
#include "Scrollbar.h"
119
#include "Scrollbar.h"
119
#include "ScrollbarTheme.h"
120
#include "ScrollbarTheme.h"
120
#include "ScrollingCoordinator.h"
121
#include "ScrollingCoordinator.h"
Lines 2484-2508 ScrollOffset RenderLayer::clampScrollOffset(const ScrollOffset& scrollOffset) co a/Source/WebCore/rendering/RenderLayer.cpp_sec2
2484
2485
2485
void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType scrollType, ScrollClamping clamping)
2486
void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType scrollType, ScrollClamping clamping)
2486
{
2487
{
2488
    bool scrollInProgress = isScrollInProgress();
2489
    if (scrollInProgress)
2490
        scrollAnimator().cancelAnimations();
2491
2487
    ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2492
    ScrollOffset clampedScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2488
    if (clampedScrollOffset == this->scrollOffset())
2493
    if (clampedScrollOffset == this->scrollOffset()) {
2494
#if ENABLE(ASYNC_SCROLLING)
2495
        // If UIScrollView is during scroll animation, the scroll offset of web side might be overriden.
2496
        // So we need to requestScrollPositionUpdate here, and check in UI side. If the scroll offset in UI side
2497
        // is different, the correct scroll offset need to sync back to Web side.
2498
        if (scrollInProgress)
2499
            requestScrollPositionUpdate(scrollPositionFromOffset(clampedScrollOffset), false);
2500
#endif
2489
        return;
2501
        return;
2502
    }
2490
2503
2491
    auto previousScrollType = currentScrollType();
2504
    auto previousScrollType = currentScrollType();
2492
    setCurrentScrollType(scrollType);
2505
    setCurrentScrollType(scrollType);
2493
2506
2494
    bool handled = false;
2495
#if ENABLE(ASYNC_SCROLLING)
2507
#if ENABLE(ASYNC_SCROLLING)
2496
    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
2508
    bool handled = requestScrollPositionUpdate(scrollPositionFromOffset(clampedScrollOffset), false);
2497
        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(clampedScrollOffset));
2498
#endif
2509
#endif
2499
2510
2500
    if (!handled)
2511
    if (scrollInProgress || !handled)
2501
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2512
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2502
2513
2503
    setCurrentScrollType(previousScrollType);
2514
    setCurrentScrollType(previousScrollType);
2504
}
2515
}
2505
2516
2517
bool RenderLayer::requestScrollPositionUpdate(const ScrollPosition& position, bool withAnimation)
2518
{
2519
#if ENABLE(ASYNC_SCROLLING)
2520
    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
2521
        return scrollingCoordinator->requestScrollPositionUpdate(*this, position, withAnimation);
2522
#endif
2523
    return false;
2524
}
2525
2526
void RenderLayer::scrollToOffsetWithAnimation(const ScrollOffset& scrollOffset, ScrollClamping clamping)
2527
{
2528
#if ENABLE(ASYNC_SCROLLING)
2529
    if (requestScrollPositionUpdate(scrollPositionFromOffset(scrollOffset), true)) {
2530
        setIsScrollInProgress(true);
2531
        return;
2532
    }
2533
#endif
2534
2535
    ScrollOffset newScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2536
    bool scrollInProgress = isScrollInProgress();
2537
    if (scrollInProgress)
2538
        scrollAnimator().cancelAnimations();
2539
    if (scrollInProgress || newScrollOffset != this->scrollOffset())
2540
        ScrollableArea::scrollToOffsetWithAnimation(newScrollOffset, clamping);
2541
}
2542
2506
void RenderLayer::scrollTo(const ScrollPosition& position)
2543
void RenderLayer::scrollTo(const ScrollPosition& position)
2507
{
2544
{
2508
    RenderBox* box = renderBox();
2545
    RenderBox* box = renderBox();
Lines 2535-2541 void RenderLayer::scrollTo(const ScrollPosition& position) a/Source/WebCore/rendering/RenderLayer.cpp_sec3
2535
#endif
2572
#endif
2536
    }
2573
    }
2537
    
2574
    
2538
    if (m_scrollPosition == newPosition) {
2575
    if (m_scrollPosition == newPosition && !isScrollInProgress()) {
2539
        // FIXME: Nothing guarantees we get a scrollTo() with an unchanged position at the end of a user gesture.
2576
        // FIXME: Nothing guarantees we get a scrollTo() with an unchanged position at the end of a user gesture.
2540
        // The ScrollingCoordinator probably needs to message the main thread when a gesture ends.
2577
        // The ScrollingCoordinator probably needs to message the main thread when a gesture ends.
2541
        if (requiresScrollPositionReconciliation()) {
2578
        if (requiresScrollPositionReconciliation()) {
Lines 2653-2658 bool RenderLayer::allowsCurrentScroll() const a/Source/WebCore/rendering/RenderLayer.cpp_sec4
2653
2690
2654
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2691
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2655
{
2692
{
2693
    // FIXME (https://webkit.org/b/189907): Make this work with nested scrollable boxes when a smooth scrolling must be performed.
2656
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2694
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2657
2695
2658
    RenderLayer* parentLayer = nullptr;
2696
    RenderLayer* parentLayer = nullptr;
Lines 2680-2688 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec5
2680
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2718
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2681
2719
2682
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2720
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2683
        if (clampedScrollOffset != scrollOffset()) {
2721
        if (isScrollInProgress() || clampedScrollOffset != scrollOffset()) {
2684
            ScrollOffset oldScrollOffset = scrollOffset();
2722
            ScrollOffset oldScrollOffset = scrollOffset();
2685
            scrollToOffset(clampedScrollOffset);
2723
            if (box->element() && useSmoothScrolling(options.behavior, *box->element()))
2724
                scrollToOffsetWithAnimation(clampedScrollOffset);
2725
            else
2726
                scrollToOffset(clampedScrollOffset);
2686
            IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2727
            IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2687
            localExposeRect.move(-scrollOffsetDifference);
2728
            localExposeRect.move(-scrollOffsetDifference);
2688
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
2729
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
Lines 2706-2712 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec6
2706
                IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
2747
                IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
2707
                // Adjust offsets if they're outside of the allowable range.
2748
                // Adjust offsets if they're outside of the allowable range.
2708
                scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2749
                scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2709
                frameView.setScrollPosition(scrollOffset);
2750
                // FIXME: Should we use contentDocument()->scrollingElement()?
2751
                // See https://github.com/w3c/csswg-drafts/issues/2977
2752
                if (ownerElement->contentDocument() && ownerElement->contentDocument()->documentElement() && useSmoothScrolling(options.behavior, *ownerElement->contentDocument()->documentElement()))
2753
                    frameView.scrollToOffsetWithAnimation(scrollOffset);
2754
                else
2755
                    frameView.setScrollPosition(scrollOffset);
2710
2756
2711
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2757
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2712
                    parentLayer = ownerElement->renderer()->enclosingLayer();
2758
                    parentLayer = ownerElement->renderer()->enclosingLayer();
Lines 2745-2751 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec7
2745
            // Avoid scrolling to the rounded value of revealRect.location() if we don't actually need to scroll
2791
            // Avoid scrolling to the rounded value of revealRect.location() if we don't actually need to scroll
2746
            if (revealRect != viewRect) {
2792
            if (revealRect != viewRect) {
2747
                ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2793
                ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2748
                frameView.setScrollPosition(clampedScrollPosition);
2794
                // FIXME: Should we use document()->scrollingElement()?
2795
                // See https://github.com/w3c/csswg-drafts/issues/2977
2796
                if (renderer().document().documentElement() && useSmoothScrolling(options.behavior, *renderer().document().documentElement()))
2797
                    frameView.scrollToOffsetWithAnimation(clampedScrollPosition);
2798
                else
2799
                    frameView.setScrollPosition(clampedScrollPosition);
2749
            }
2800
            }
2750
2801
2751
            // This is the outermost view of a web page, so after scrolling this view we
2802
            // This is the outermost view of a web page, so after scrolling this view we
- a/Source/WebCore/rendering/RenderLayer.h +5 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-439 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&, ScrollClamping = ScrollClamping::Clamped);
440
441
    bool requestScrollPositionUpdate(const ScrollPosition&, bool withAnimation = false) override;
437
442
438
    void scrollToXPosition(int x, ScrollType, ScrollClamping = ScrollClamping::Clamped);
443
    void scrollToXPosition(int x, ScrollType, ScrollClamping = ScrollClamping::Clamped);
439
    void scrollToYPosition(int y, ScrollType, ScrollClamping = ScrollClamping::Clamped);
444
    void scrollToYPosition(int y, ScrollType, ScrollClamping = ScrollClamping::Clamped);
- a/Source/WebCore/rendering/style/RenderStyle.h +6 lines
Lines 738-743 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
738
    bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
738
    bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; }
739
#endif
739
#endif
740
740
741
    bool useSmoothScrolling() const { return m_rareNonInheritedData->useSmoothScrolling; }
742
741
#if ENABLE(TEXT_AUTOSIZING)
743
#if ENABLE(TEXT_AUTOSIZING)
742
    TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
744
    TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; }
743
    AutosizeStatus autosizeStatus() const;
745
    AutosizeStatus autosizeStatus() const;
Lines 1248-1253 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
1248
    void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
1250
    void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); }
1249
#endif
1251
#endif
1250
1252
1253
    void setUseSmoothScrolling(bool v) { SET_VAR(m_rareNonInheritedData, useSmoothScrolling, v); }
1254
1251
#if ENABLE(TEXT_AUTOSIZING)
1255
#if ENABLE(TEXT_AUTOSIZING)
1252
    void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
1256
    void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); }
1253
    void setAutosizeStatus(AutosizeStatus);
1257
    void setAutosizeStatus(AutosizeStatus);
Lines 1686-1691 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec3
1686
    static bool initialUseTouchOverflowScrolling() { return false; }
1690
    static bool initialUseTouchOverflowScrolling() { return false; }
1687
#endif
1691
#endif
1688
1692
1693
    static bool initialUseSmoothScrolling() { return false; }
1694
1689
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1695
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1690
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1696
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1691
1697
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +3 lines
Lines 80-85 StyleRareNonInheritedData::StyleRareNonInheritedData() a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec1
80
#if ENABLE(POINTER_EVENTS)
80
#if ENABLE(POINTER_EVENTS)
81
    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
81
    , touchActions(static_cast<unsigned>(RenderStyle::initialTouchActions()))
82
#endif
82
#endif
83
    , useSmoothScrolling(static_cast<unsigned>(RenderStyle::initialUseSmoothScrolling()))
83
    , pageSizeType(PAGE_SIZE_AUTO)
84
    , pageSizeType(PAGE_SIZE_AUTO)
84
    , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
85
    , transformStyle3D(static_cast<unsigned>(RenderStyle::initialTransformStyle3D()))
85
    , backfaceVisibility(static_cast<unsigned>(RenderStyle::initialBackfaceVisibility()))
86
    , backfaceVisibility(static_cast<unsigned>(RenderStyle::initialBackfaceVisibility()))
Lines 174-179 inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec2
174
#if ENABLE(POINTER_EVENTS)
175
#if ENABLE(POINTER_EVENTS)
175
    , touchActions(o.touchActions)
176
    , touchActions(o.touchActions)
176
#endif
177
#endif
178
    , useSmoothScrolling(o.useSmoothScrolling)
177
    , pageSizeType(o.pageSizeType)
179
    , pageSizeType(o.pageSizeType)
178
    , transformStyle3D(o.transformStyle3D)
180
    , transformStyle3D(o.transformStyle3D)
179
    , backfaceVisibility(o.backfaceVisibility)
181
    , backfaceVisibility(o.backfaceVisibility)
Lines 286-291 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec3
286
#if ENABLE(POINTER_EVENTS)
288
#if ENABLE(POINTER_EVENTS)
287
        && touchActions == o.touchActions
289
        && touchActions == o.touchActions
288
#endif
290
#endif
291
        && useSmoothScrolling == o.useSmoothScrolling
289
#if ENABLE(CSS_COMPOSITING)
292
#if ENABLE(CSS_COMPOSITING)
290
        && effectiveBlendMode == o.effectiveBlendMode
293
        && effectiveBlendMode == o.effectiveBlendMode
291
        && isolation == o.isolation
294
        && 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/testing/Internals.cpp -1 / +1 lines
Lines 1732-1738 ExceptionOr<void> Internals::unconstrainedScrollTo(Element& element, double x, d a/Source/WebCore/testing/Internals.cpp_sec1
1732
    if (!document || !document->view())
1732
    if (!document || !document->view())
1733
        return Exception { InvalidAccessError };
1733
        return Exception { InvalidAccessError };
1734
1734
1735
    element.scrollTo({ x, y }, ScrollClamping::Unclamped);
1735
    element.scrollTo(fromCoordinates(x, y), ScrollClamping::Unclamped);
1736
    return { };
1736
    return { };
1737
}
1737
}
1738
1738
- a/Source/WebKit/ChangeLog +11 lines
Lines 1-3 a/Source/WebKit/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
        Add CSSOM smooth scrolling as an experimental feature.
9
10
        * Shared/WebPreferences.yaml:
11
1
2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
12
2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
2
13
3
        [GTK][WPE] Fixes for non-unified builds after r249714
14
        [GTK][WPE] Fixes for non-unified builds after r249714
- 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 1299-1304 BlockingOfSmallPluginsEnabled: a/Source/WebKit/Shared/WebPreferences.yaml_sec1
1299
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1299
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1300
  category: internal
1300
  category: internal
1301
1301
1302
CSSOMViewSmoothScrollingEnabled:
1303
  type: bool
1304
  defaultValue: true
1305
  humanReadableName: "CSSOM View Smooth Scrolling"
1306
  humanReadableDescription: "Enable DOM API and CSS property for 'smooth' scroll behavior"
1307
  category: experimental
1308
1302
WebAnimationsEnabled:
1309
WebAnimationsEnabled:
1303
  type: bool
1310
  type: bool
1304
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
1311
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp -2 / +7 lines
Lines 206-212 void RemoteScrollingCoordinatorProxy::currentSnapPointIndicesDidChange(WebCore:: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec1
206
}
206
}
207
207
208
// This comes from the scrolling tree.
208
// This comes from the scrolling tree.
209
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
209
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction, bool instantScrollDidStopAnimation)
210
{
210
{
211
    // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
211
    // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
212
    // so don't send them here.
212
    // so don't send them here.
Lines 220-226 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec2
220
    m_webPageProxy.scrollingNodeScrollViewDidScroll();
220
    m_webPageProxy.scrollingNodeScrollViewDidScroll();
221
#endif
221
#endif
222
222
223
    if (m_scrollingTree->isHandlingProgrammaticScroll())
223
    if (m_scrollingTree->isHandlingProgrammaticScroll() && !instantScrollDidStopAnimation)
224
        return;
224
        return;
225
225
226
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync));
226
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync));
Lines 235-240 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingN a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec3
235
    }
235
    }
236
}
236
}
237
237
238
void RemoteScrollingCoordinatorProxy::scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID scrolledNodeID, bool isScrollAnimationInProgress)
239
{
240
    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::IsScrollAnimationInProgressChangedForNode(scrolledNodeID, isScrollAnimationInProgress));
241
}
242
238
String RemoteScrollingCoordinatorProxy::scrollingTreeAsText() const
243
String RemoteScrollingCoordinatorProxy::scrollingTreeAsText() const
239
{
244
{
240
    if (m_scrollingTree)
245
    if (m_scrollingTree)
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h -1 / +3 lines
Lines 56-64 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);
61
61
62
    void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool isScrollAnimationInProgress);
63
62
    WebCore::TrackingType eventTrackingTypeForPoint(const AtomString& eventName, WebCore::IntPoint) const;
64
    WebCore::TrackingType eventTrackingTypeForPoint(const AtomString& eventName, WebCore::IntPoint) const;
63
65
64
    // Called externally when native views move around.
66
    // Called externally when native views move around.
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp -1 / +6 lines
Lines 104-110 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.stopScrollAnimation() && !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)
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 +2 lines
Lines 54-59 public: a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h_sec1
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) override;
56
56
57
    void scrollingTreeNodeIsScrollAnimationInProgressDidChange(WebCore::ScrollingNodeID, bool isScrollAnimationInProgress) override;
58
57
    void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
59
    void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
58
60
59
private:
61
private:
- 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 / +40 lines
Lines 33-38 a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec1
33
#import "RemoteScrollingTree.h"
33
#import "RemoteScrollingTree.h"
34
#import "UIKitSPI.h"
34
#import "UIKitSPI.h"
35
#import "WebPageProxy.h"
35
#import "WebPageProxy.h"
36
#import "Logging.h"
36
#import <QuartzCore/QuartzCore.h>
37
#import <QuartzCore/QuartzCore.h>
37
#import <UIKit/UIPanGestureRecognizer.h>
38
#import <UIKit/UIPanGestureRecognizer.h>
38
#import <UIKit/UIScrollView.h>
39
#import <UIKit/UIScrollView.h>
Lines 152-157 a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec2
152
    }
153
    }
153
}
154
}
154
155
156
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
157
{
158
    _scrollingTreeNodeDelegate->scrollViewDidEndScrollingAnimation();
159
}
160
155
#if ENABLE(POINTER_EVENTS)
161
#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
162
- (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
{
163
{
Lines 300-314 void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const Scrol a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec3
300
306
301
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
307
    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
302
        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
308
        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
303
        scrollingNode().scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType);
309
        if (scrollingStateNode.requestedScrollPositionWithAnimation())
310
            scrollingNode().setRequestScrollWithAnimation(true);
311
        // If the scroll positions are not same, there's a posibility that the scroll offset from web has been overriden.
312
        // In this case, it need to sync the scroll offset back to Web side.
313
        bool needSyncBack = scrollingStateNode.scrollPosition() != scrollingNode().currentScrollPosition();
314
        scrollingNode().scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType, ScrollPositionClamp::ToContentEdges, needSyncBack);
304
    }
315
    }
305
}
316
}
306
317
307
void ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers()
318
void ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers()
308
{
319
{
309
    BEGIN_BLOCK_OBJC_EXCEPTIONS
320
    bool animationInProgress = scrollingNode().scrollAnimationInProgress();
310
    [scrollView() setContentOffset:scrollingNode().currentScrollOffset()];
321
    bool needToStopAnimation = scrollingNode().stopScrollAnimation();
311
    END_BLOCK_OBJC_EXCEPTIONS
322
    if (needToStopAnimation && animationInProgress) {
323
        BEGIN_BLOCK_OBJC_EXCEPTIONS
324
        [scrollView() setContentOffset:scrollView().contentOffset animated:NO];
325
        END_BLOCK_OBJC_EXCEPTIONS
326
    }
327
328
    if (scrollingNode().requestScrollWithAnimation()) {
329
        BEGIN_BLOCK_OBJC_EXCEPTIONS
330
        [scrollView() setContentOffset:scrollingNode().currentScrollOffset() animated:YES];
331
        END_BLOCK_OBJC_EXCEPTIONS
332
333
        scrollingNode().setScrollAnimationInProgress(true);
334
    } else if (!animationInProgress || needToStopAnimation) {
335
        BEGIN_BLOCK_OBJC_EXCEPTIONS
336
        [scrollView() setContentOffset:scrollingNode().currentScrollOffset()];
337
        END_BLOCK_OBJC_EXCEPTIONS
338
    }
312
}
339
}
313
340
314
void ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart() const
341
void ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart() const
Lines 335-340 void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll(const FloatPoint a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec4
335
    scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition, { }, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
362
    scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition, { }, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
336
}
363
}
337
364
365
void ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidEndScrollingAnimation()
366
{
367
    auto& node = scrollingNode();
368
    if (!(node.requestScrollWithAnimation() && node.scrollAnimationInProgress())) {
369
        scrollingTree().scrollingTreeNodeIsScrollAnimationInProgressDidChange(node.scrollingNodeID(), false);
370
        node.setScrollAnimationInProgress(false);
371
    }
372
}
373
338
void ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const
374
void ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const
339
{
375
{
340
    if (m_updatingFromStateNode)
376
    if (m_updatingFromStateNode)
- 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 isScrollAnimationInProgressChangedForNode(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
    IsScrollAnimationInProgressChangedForNode(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 +6 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::isScrollAnimationInProgressChangedForNode(WebCore::ScrollingNodeID nodeID, bool isScrollAnimationInProgress)
108
{
109
    // TODO cc: sync to scrollableArea.
110
    setScrollAnimationInProgress(nodeID, isScrollAnimationInProgress);
111
}
112
107
} // namespace WebKit
113
} // namespace WebKit
108
114
109
#endif // ENABLE(ASYNC_SCROLLING)
115
#endif // ENABLE(ASYNC_SCROLLING)
- 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/WebPreferencesPrivate.h: Ditto.
10
        * WebView/WebView.mm:
11
        (-[WebView _preferencesChanged:]): Ditto.
12
13
        * WebView/WebPreferences.mm:
14
        (+[WebPreferences initialize]): Disable CSSOMViewSmoothScrolling by default.
15
        (-[WebPreferences CSSOMViewSmoothScrollingEnabled]): Getter.
16
        (-[WebPreferences setCSSOMViewSmoothScrollingEnabled:]): Setter.
17
1
2019-09-25  Megan Gardner  <megan_gardner@apple.com>
18
2019-09-25  Megan Gardner  <megan_gardner@apple.com>
2
19
3
        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
20
        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are 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 WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
191
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
191
#define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
192
#define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm +11 lines
Lines 650-655 public: a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec1
650
#endif
650
#endif
651
651
652
        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
652
        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
653
        @NO, WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey,
653
        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
654
        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
654
        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
655
        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
655
#if ENABLE(MEDIA_STREAM)
656
#if ENABLE(MEDIA_STREAM)
Lines 3155-3160 static NSString *classIBCreatorID = nil; a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec2
3155
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3156
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3156
}
3157
}
3157
3158
3159
- (BOOL)CSSOMViewSmoothScrollingEnabled
3160
{
3161
    return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3162
}
3163
3164
- (void)setCSSOMViewSmoothScrollingEnabled:(BOOL)flag
3165
{
3166
    [self _setBoolValue:flag forKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3167
}
3168
3158
- (BOOL)webAnimationsEnabled
3169
- (BOOL)webAnimationsEnabled
3159
{
3170
{
3160
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
3171
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h +1 lines
Lines 617-622 extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h_sec1
617
617
618
@property (nonatomic) BOOL visualViewportAPIEnabled;
618
@property (nonatomic) BOOL visualViewportAPIEnabled;
619
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
619
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
620
@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
620
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
621
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
621
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
622
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
622
@property (nonatomic) BOOL javaScriptMarkupEnabled;
623
@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/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-09-27  Chris Dumez  <cdumez@apple.com>
18
2019-09-27  Chris Dumez  <cdumez@apple.com>
2
19
3
        Pages using WebGLRenderingContext fail to enter the back/forward cache
20
        Pages using WebGLRenderingContext fail to enter the back/forward cache
- 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
    defaultSettings = defaults;
344
    defaultSettings = defaults;
Lines 2276-2281 HRESULT WebPreferences::setCoreMathMLEnabled(BOOL enabled) a/Source/WebKitLegacy/win/WebPreferences.cpp_sec2
2276
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2278
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2277
    return S_OK;
2279
    return S_OK;
2278
}
2280
}
2281
    
2282
HRESULT WebPreferences::CSSOMViewSmoothScrollingEnabled(_Out_ BOOL* enabled)
2283
{
2284
    if (!enabled)
2285
        return E_POINTER;
2286
    *enabled = boolValueForKey(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey);
2287
    return S_OK;
2288
}
2289
2290
HRESULT WebPreferences::setCSSOMViewSmoothScrollingEnabled(BOOL enabled)
2291
{
2292
    setBoolValue(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey, enabled);
2293
    return S_OK;
2294
}
2279
2295
2280
HRESULT WebPreferences::setApplicationId(BSTR applicationId)
2296
HRESULT WebPreferences::setApplicationId(BSTR applicationId)
2281
{
2297
{
- 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 5299-5304 HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) a/Source/WebKitLegacy/win/WebView.cpp_sec1
5299
        return hr;
5299
        return hr;
5300
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5300
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5301
5301
5302
    hr = prefsPrivate->CSSOMViewSmoothScrollingEnabled(&enabled);
5303
    if (FAILED(hr))
5304
        return hr;
5305
    settings.setCSSOMViewSmoothScrollingEnabled(!!enabled);
5306
5302
    hr = preferences->privateBrowsingEnabled(&enabled);
5307
    hr = preferences->privateBrowsingEnabled(&enabled);
5303
    if (FAILED(hr))
5308
    if (FAILED(hr))
5304
        return hr;
5309
        return hr;
- a/Tools/ChangeLog +11 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
        * DumpRenderTree/TestOptions.cpp:
7
        (TestOptions::TestOptions): Parse CSSOMViewSmoothScrollingEnabled.
8
        * DumpRenderTree/TestOptions.h: Add CSSOMViewSmoothScrollingEnabled, disabled by default.
9
        * DumpRenderTree/mac/DumpRenderTree.mm:
10
        (setWebPreferencesForTestOptions): Set CSSOMViewSmoothScrollingEnabled from the test options.
11
1
2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
12
2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
2
13
3
        Support accessibility for <figure> element on iOS.
14
        Support accessibility for <figure> element on iOS.
- 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
        pairStart = pairEnd + 1;
128
        pairStart = pairEnd + 1;
- 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
    std::string jscOptions;
55
    std::string jscOptions;
55
    std::string additionalSupportedImageTypes;
56
    std::string additionalSupportedImageTypes;
- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +1 lines
Lines 1026-1031 static void setWebPreferencesForTestOptions(const TestOptions& options) a/Tools/DumpRenderTree/mac/DumpRenderTree.mm_sec1
1026
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1026
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1027
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1027
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1028
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1028
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1029
    preferences.CSSOMViewSmoothScrollingEnabled = options.enableCSSOMViewSmoothScrolling;
1029
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1030
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1030
    preferences.privateBrowsingEnabled = options.useEphemeralSession;
1031
    preferences.privateBrowsingEnabled = options.useEphemeralSession;
1031
    preferences.usesPageCache = options.enablePageCache;
1032
    preferences.usesPageCache = options.enablePageCache;

Return to Bug 188043