这是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-06-24  Wenson Hsieh  <wenson_hsieh@apple.com>
11
2019-06-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2
12
3
        [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
13
        [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
- 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-06-24  Antoine Quint  <graouts@apple.com>
26
2019-06-24  Antoine Quint  <graouts@apple.com>
2
27
3
        [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
28
        [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
- 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
<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-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 694-699 webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-s a/LayoutTests/platform/mac-wk1/TestExpectations_sec1
694
694
695
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
695
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
696
696
697
# Tests for smooth scroll behavior do not all work and they are slow, so let's just skip them.
698
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-root.html [ Skip ]
699
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-main-frame-window.html [ Skip ]
700
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-root.html [ Skip ]
701
webkit.org/b/191357 imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html [ Skip ]
702
697
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
703
webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
698
704
699
webkit.org/b/189756 [ Mojave+ ] compositing/filters/opacity-change-on-filtered-paints-into-ancestor.html [ Pass ImageOnlyFailure ]
705
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 933-940 set(WebCore_NON_SVG_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec1
933
    page/ResizeObserverCallback.idl
933
    page/ResizeObserverCallback.idl
934
    page/ResizeObserverEntry.idl
934
    page/ResizeObserverEntry.idl
935
    page/Screen.idl
935
    page/Screen.idl
936
    page/ScrollBehavior.idl
936
    page/ScrollIntoViewOptions.idl
937
    page/ScrollIntoViewOptions.idl
937
    page/ScrollLogicalPosition.idl
938
    page/ScrollLogicalPosition.idl
939
    page/ScrollOptions.idl
938
    page/ScrollToOptions.idl
940
    page/ScrollToOptions.idl
939
    page/ShareData.idl
941
    page/ShareData.idl
940
    page/UndoItem.idl
942
    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-06-24  Wenson Hsieh  <wenson_hsieh@apple.com>
146
2019-06-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2
147
3
        [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
148
        [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
- a/Source/WebCore/DerivedSources.make +2 lines
Lines 879-886 JS_BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
879
    $(WebCore)/page/ResizeObserverCallback.idl \
879
    $(WebCore)/page/ResizeObserverCallback.idl \
880
    $(WebCore)/page/ResizeObserverEntry.idl \
880
    $(WebCore)/page/ResizeObserverEntry.idl \
881
    $(WebCore)/page/Screen.idl \
881
    $(WebCore)/page/Screen.idl \
882
    $(WebCore)/page/ScrollBehavior.idl \
882
    $(WebCore)/page/ScrollIntoViewOptions.idl \
883
    $(WebCore)/page/ScrollIntoViewOptions.idl \
883
    $(WebCore)/page/ScrollLogicalPosition.idl \
884
    $(WebCore)/page/ScrollLogicalPosition.idl \
885
    $(WebCore)/page/ScrollOptions.idl \
884
    $(WebCore)/page/ScrollToOptions.idl \
886
    $(WebCore)/page/ScrollToOptions.idl \
885
    $(WebCore)/page/ShareData.idl \
887
    $(WebCore)/page/ShareData.idl \
886
    $(WebCore)/page/UndoItem.idl \
888
    $(WebCore)/page/UndoItem.idl \
- a/Source/WebCore/Headers.cmake +2 lines
Lines 805-812 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec1
805
    page/RemoteFrame.h
805
    page/RemoteFrame.h
806
    page/RenderingUpdateScheduler.h
806
    page/RenderingUpdateScheduler.h
807
    page/RuntimeEnabledFeatures.h
807
    page/RuntimeEnabledFeatures.h
808
    page/ScrollBehavior.h
808
    page/ScrollIntoViewOptions.h
809
    page/ScrollIntoViewOptions.h
809
    page/ScrollLogicalPosition.h
810
    page/ScrollLogicalPosition.h
811
    page/ScrollOptions.h
810
    page/ScrollToOptions.h
812
    page/ScrollToOptions.h
811
    page/SecurityOrigin.h
813
    page/SecurityOrigin.h
812
    page/SecurityOriginData.h
814
    page/SecurityOriginData.h
- a/Source/WebCore/Sources.txt +4 lines
Lines 1554-1559 page/ResourceUsageOverlay.cpp a/Source/WebCore/Sources.txt_sec1
1554
page/ResourceUsageThread.cpp
1554
page/ResourceUsageThread.cpp
1555
page/RuntimeEnabledFeatures.cpp
1555
page/RuntimeEnabledFeatures.cpp
1556
page/Screen.cpp
1556
page/Screen.cpp
1557
page/ScrollBehavior.cpp
1557
page/SecurityOrigin.cpp
1558
page/SecurityOrigin.cpp
1558
page/SecurityOriginData.cpp
1559
page/SecurityOriginData.cpp
1559
page/SecurityPolicy.cpp
1560
page/SecurityPolicy.cpp
Lines 1657-1662 platform/RuntimeApplicationChecks.cpp a/Source/WebCore/Sources.txt_sec2
1657
platform/SSLKeyGenerator.cpp
1658
platform/SSLKeyGenerator.cpp
1658
platform/SchemeRegistry.cpp
1659
platform/SchemeRegistry.cpp
1659
platform/ScrollAnimator.cpp
1660
platform/ScrollAnimator.cpp
1661
platform/ScrollAnimationSmooth.cpp
1660
platform/ScrollView.cpp
1662
platform/ScrollView.cpp
1661
platform/ScrollableArea.cpp
1663
platform/ScrollableArea.cpp
1662
platform/Scrollbar.cpp
1664
platform/Scrollbar.cpp
Lines 3237-3244 JSSVGZoomEvent.cpp a/Source/WebCore/Sources.txt_sec3
3237
JSScreen.cpp
3239
JSScreen.cpp
3238
JSScreenLuminance.cpp
3240
JSScreenLuminance.cpp
3239
JSScriptProcessorNode.cpp
3241
JSScriptProcessorNode.cpp
3242
JSScrollBehavior.cpp
3240
JSScrollIntoViewOptions.cpp
3243
JSScrollIntoViewOptions.cpp
3241
JSScrollLogicalPosition.cpp
3244
JSScrollLogicalPosition.cpp
3245
JSScrollOptions.cpp
3242
JSScrollToOptions.cpp
3246
JSScrollToOptions.cpp
3243
JSSecurityPolicyViolationEvent.cpp
3247
JSSecurityPolicyViolationEvent.cpp
3244
JSServiceWorker.cpp
3248
JSServiceWorker.cpp
- a/Source/WebCore/SourcesGTK.txt -1 lines
Lines 60-66 page/scrolling/nicosia/ScrollingTreeStickyNode.cpp a/Source/WebCore/SourcesGTK.txt_sec1
60
page/scrolling/generic/ScrollingThreadGeneric.cpp
60
page/scrolling/generic/ScrollingThreadGeneric.cpp
61
61
62
platform/ScrollAnimationKinetic.cpp
62
platform/ScrollAnimationKinetic.cpp
63
platform/ScrollAnimationSmooth.cpp
64
platform/UserAgentQuirks.cpp
63
platform/UserAgentQuirks.cpp
65
64
66
platform/generic/ScrollAnimatorGeneric.cpp
65
platform/generic/ScrollAnimatorGeneric.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +28 lines
Lines 2406-2411 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
2406
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2406
		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
2407
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2407
		834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; };
2408
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2408
		834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; };
2409
		834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */; };
2410
		834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */; };
2409
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2411
		834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; };
2410
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2412
		8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; };
2411
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
2413
		834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 2461-2466 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
2461
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2463
		83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; };
2462
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2464
		83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
2463
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2465
		83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2466
		83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356424 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
2467
		83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356435 /* ScrollOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2464
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2468
		83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2465
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2469
		83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; };
2466
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
2470
		83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; };
Lines 10037-10042 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
10037
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10041
		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
10038
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10042
		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
10039
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10043
		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
10044
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10045
		8350C3E71DA59B6200356424 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
10046
		8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
10047
		8350C3E81DA59B6200356424 /* ScrollBehavior.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollBehavior.idl; sourceTree = "<group>"; };
10048
		8350C3E71DA59B6200356435 /* ScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollOptions.h; sourceTree = "<group>"; };
10049
		8350C3E81DA59B6200356435 /* ScrollOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollOptions.idl; sourceTree = "<group>"; };
10040
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10050
		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
10041
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10051
		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
10042
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
10052
		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
Lines 10158-10163 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
10158
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10168
		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
10159
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10169
		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
10160
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10170
		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
10171
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10172
		83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollBehavior.cpp; sourceTree = "<group>"; };
10173
		83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollBehavior.h; sourceTree = "<group>"; };
10174
		83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollOptions.cpp; sourceTree = "<group>"; };
10175
		83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollOptions.h; sourceTree = "<group>"; };
10161
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10176
		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
10162
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10177
		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
10163
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
10178
		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
Lines 20351-20360 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
20351
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20366
				BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
20352
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20367
				BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
20353
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20368
				BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
20369
				8350C3E71DA59B6200356434 /* ScrollBehavior.cpp */,
20370
				8350C3E71DA59B6200356424 /* ScrollBehavior.h */,
20371
				8350C3E81DA59B6200356424 /* ScrollBehavior.idl */,
20354
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20372
				8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */,
20355
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20373
				8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */,
20356
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20374
				8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */,
20357
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20375
				8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */,
20376
				8350C3E71DA59B6200356435 /* ScrollOptions.h */,
20377
				8350C3E81DA59B6200356435 /* ScrollOptions.idl */,
20358
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20378
				8350C3E71DA59B6200356446 /* ScrollToOptions.h */,
20359
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20379
				8350C3E81DA59B6200356446 /* ScrollToOptions.idl */,
20360
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
20380
				BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */,
Lines 25067-25076 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
25067
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25087
				58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */,
25068
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25088
				BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
25069
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25089
				BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
25090
				83E9B3001DA5A51E00FFE8D4 /* JSScrollBehavior.cpp */,
25091
				83E9B3011DA5A51E00FFE8D4 /* JSScrollBehavior.h */,
25070
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25092
				83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */,
25071
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25093
				83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */,
25072
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25094
				83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */,
25073
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25095
				83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */,
25096
				83E9B3001DA5A51E00FFE8E5 /* JSScrollOptions.cpp */,
25097
				83E9B3011DA5A51E00FFE8E5 /* JSScrollOptions.h */,
25074
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25098
				83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */,
25075
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25099
				83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */,
25076
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
25100
				7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */,
Lines 30210-30217 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
30210
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30234
				5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
30211
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30235
				BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
30212
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30236
				FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
30237
				834476EF1DA5BC5E002B6EB0 /* JSScrollBehavior.h in Headers */,
30213
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30238
				834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */,
30214
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30239
				834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */,
30240
				834476EF1DA5BC5E002B6EC1 /* JSScrollOptions.h in Headers */,
30215
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30241
				834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
30216
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30242
				CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
30217
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
30243
				5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
Lines 31394-31399 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
31394
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
31420
				44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
31395
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
31421
				BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
31396
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
31422
				0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
31423
				83C5795D1DA5C301006FAC86 /* ScrollBehavior.h in Headers */,
31397
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
31424
				1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
31398
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
31425
				0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
31399
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
31426
				1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
Lines 31430-31435 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec9
31430
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
31457
				83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */,
31431
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
31458
				7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */,
31432
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
31459
				83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */,
31460
				83C5795D1DA5C301006FAC97 /* ScrollOptions.h in Headers */,
31433
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
31461
				F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */,
31434
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
31462
				F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */,
31435
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
31463
				83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
- 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 3717-3722 RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
3717
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3720
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3718
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3721
            return cssValuePool.createIdentifierValue(CSSValueTouch);
3719
#endif
3722
#endif
3723
        case CSSPropertyScrollBehavior:
3724
            if (!style.useSmoothScrolling())
3725
                return cssValuePool.createIdentifierValue(CSSValueAuto);
3726
            return cssValuePool.createIdentifierValue(CSSValueSmooth);
3720
        case CSSPropertyPerspective:
3727
        case CSSPropertyPerspective:
3721
            if (!style.hasPerspective())
3728
            if (!style.hasPerspective())
3722
                return cssValuePool.createIdentifierValue(CSSValueNone);
3729
                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 110-116 struct CSSParserContextHash { a/Source/WebCore/css/parser/CSSParserContext.h_sec2
110
#if ENABLE(ATTACHMENT_ELEMENT)
111
#if ENABLE(ATTACHMENT_ELEMENT)
111
            & key.attachmentEnabled                         << 11
112
            & key.attachmentEnabled                         << 11
112
#endif
113
#endif
113
            & key.mode                                      << 12; // Keep this last.
114
            & key.scrollBehaviorEnabled                     << 12
115
            & key.mode                                      << 13; // Keep this last.
114
        hash ^= WTF::intHash(bits);
116
        hash ^= WTF::intHash(bits);
115
        return hash;
117
        return hash;
116
    }
118
    }
- 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 2323-2328 static RefPtr<CSSValueList> consumeScrollSnapType(CSSParserTokenRange& range) a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec1
2323
2323
2324
#endif
2324
#endif
2325
2325
2326
static RefPtr<CSSPrimitiveValue> consumeScrollBehavior(CSSParserTokenRange& range)
2327
{
2328
    auto valueID = range.peek().id();
2329
    if (valueID != CSSValueAuto && valueID != CSSValueSmooth)
2330
        return nullptr;
2331
    return consumeIdent(range);
2332
}
2333
2326
static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
2334
static RefPtr<CSSValue> consumeBorderRadiusCorner(CSSParserTokenRange& range, CSSParserMode cssParserMode)
2327
{
2335
{
2328
    RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
2336
    RefPtr<CSSPrimitiveValue> parsedValue1 = consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative);
Lines 3922-3927 RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec2
3922
    case CSSPropertyScrollSnapType:
3930
    case CSSPropertyScrollSnapType:
3923
        return consumeScrollSnapType(m_range);
3931
        return consumeScrollSnapType(m_range);
3924
#endif
3932
#endif
3933
    case CSSPropertyScrollBehavior:
3934
        if (!m_context.scrollBehaviorEnabled)
3935
            return nullptr;
3936
        return consumeScrollBehavior(m_range);
3925
    case CSSPropertyClip:
3937
    case CSSPropertyClip:
3926
        return consumeClip(m_range, m_context.mode);
3938
        return consumeClip(m_range, m_context.mode);
3927
#if ENABLE(POINTER_EVENTS)
3939
#if ENABLE(POINTER_EVENTS)
- a/Source/WebCore/dom/Element.cpp -8 / +21 lines
Lines 729-735 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec1
729
    bool insideFixed;
729
    bool insideFixed;
730
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
730
    LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed);
731
731
732
    // FIXME(webkit.org/b/188043): Support ScrollBehavior.
733
    ScrollIntoViewOptions options;
732
    ScrollIntoViewOptions options;
734
    if (arg) {
733
    if (arg) {
735
        auto value = arg.value();
734
        auto value = arg.value();
Lines 739-747 void Element::scrollIntoView(Optional<Variant<bool, ScrollIntoViewOptions>>&& ar a/Source/WebCore/dom/Element.cpp_sec2
739
            options.blockPosition = ScrollLogicalPosition::End;
738
            options.blockPosition = ScrollLogicalPosition::End;
740
    }
739
    }
741
740
742
    ScrollAlignment alignX = toScrollAlignment(options.inlinePosition, false);
741
    ScrollRectToVisibleOptions scrollRectToVisibleOptions {
743
    ScrollAlignment alignY = toScrollAlignment(options.blockPosition, true);
742
        SelectionRevealMode::Reveal,
744
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, { SelectionRevealMode::Reveal, alignX, alignY, ShouldAllowCrossOriginScrolling::No });
743
        toScrollAlignment(options.inlinePosition, false),
744
        toScrollAlignment(options.blockPosition, true),
745
        ShouldAllowCrossOriginScrolling::No,
746
    };
747
    if (options.behavior)
748
        scrollRectToVisibleOptions.behavior = options.behavior.value();
749
    renderer()->scrollRectToVisible(absoluteBounds, insideFixed, scrollRectToVisibleOptions);
745
}
750
}
746
751
747
void Element::scrollIntoView(bool alignToTop) 
752
void Element::scrollIntoView(bool alignToTop) 
Lines 800-806 void Element::scrollBy(const ScrollToOptions& options) a/Source/WebCore/dom/Element.cpp_sec3
800
805
801
void Element::scrollBy(double x, double y)
806
void Element::scrollBy(double x, double y)
802
{
807
{
803
    scrollBy({ x, y });
808
    scrollBy(fromCoordinates(x, y));
804
}
809
}
805
810
806
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
811
void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping)
Lines 836-848 void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) a/Source/WebCore/dom/Element.cpp_sec4
836
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
841
        adjustForAbsoluteZoom(renderer->scrollLeft(), *renderer),
837
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
842
        adjustForAbsoluteZoom(renderer->scrollTop(), *renderer)
838
    );
843
    );
839
    renderer->setScrollLeft(clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
844
    IntPoint scrollPosition(
840
    renderer->setScrollTop(clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom()), ScrollType::Programmatic, clamping);
845
        clampToInteger(scrollToOptions.left.value() * renderer->style().effectiveZoom()),
846
        clampToInteger(scrollToOptions.top.value() * renderer->style().effectiveZoom())
847
    );
848
    if (useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *this)) {
849
        renderer->scrollToPositionWithAnimation(scrollPosition, clamping);
850
        return;
851
    }
852
    renderer->setScrollLeft(scrollPosition.x(), ScrollType::Programmatic, clamping);
853
    renderer->setScrollTop(scrollPosition.y(), ScrollType::Programmatic, clamping);
841
}
854
}
842
855
843
void Element::scrollTo(double x, double y)
856
void Element::scrollTo(double x, double y)
844
{
857
{
845
    scrollTo({ x, y });
858
    scrollTo(fromCoordinates(x, y));
846
}
859
}
847
860
848
void Element::scrollByUnits(int units, ScrollGranularity granularity)
861
void Element::scrollByUnits(int units, ScrollGranularity granularity)
- a/Source/WebCore/page/DOMWindow.cpp -4 / +10 lines
Lines 1567-1573 double DOMWindow::devicePixelRatio() const a/Source/WebCore/page/DOMWindow.cpp_sec1
1567
1567
1568
void DOMWindow::scrollBy(double x, double y) const
1568
void DOMWindow::scrollBy(double x, double y) const
1569
{
1569
{
1570
    scrollBy({ x, y });
1570
    scrollBy(fromCoordinates(x, y));
1571
}
1571
}
1572
1572
1573
void DOMWindow::scrollBy(const ScrollToOptions& options) const
1573
void DOMWindow::scrollBy(const ScrollToOptions& options) const
Lines 1589-1598 void DOMWindow::scrollBy(const ScrollToOptions& options) const a/Source/WebCore/page/DOMWindow.cpp_sec2
1589
1589
1590
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1590
void DOMWindow::scrollTo(double x, double y, ScrollClamping clamping) const
1591
{
1591
{
1592
    scrollTo({ x, y }, clamping);
1592
    scrollTo(fromCoordinates(x, y), clamping);
1593
}
1593
}
1594
1594
1595
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const
1595
void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping clamping) const
1596
{
1596
{
1597
    if (!isCurrentlyDisplayedInFrame())
1597
    if (!isCurrentlyDisplayedInFrame())
1598
        return;
1598
        return;
Lines 1605-1616 void DOMWindow::scrollTo(const ScrollToOptions& options, ScrollClamping) const a/Source/WebCore/page/DOMWindow.cpp_sec3
1605
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1605
        view->contentsScrollPosition().x(), view->contentsScrollPosition().y()
1606
    );
1606
    );
1607
1607
1608
    if (!scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1608
    if (!view->isScrollInProgress() && !scrollToOptions.left.value() && !scrollToOptions.top.value() && view->contentsScrollPosition() == IntPoint(0, 0))
1609
        return;
1609
        return;
1610
1610
1611
    document()->updateLayoutIgnorePendingStylesheets();
1611
    document()->updateLayoutIgnorePendingStylesheets();
1612
1612
1613
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1613
    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(scrollToOptions.left.value()), view->mapFromCSSToLayoutUnits(scrollToOptions.top.value()));
1614
    // FIXME: Should we use document()->scrollingElement()?
1615
    // See https://github.com/w3c/csswg-drafts/issues/2977
1616
    if (document()->documentElement() && useSmoothScrolling(scrollToOptions.behavior.valueOr(ScrollBehavior::Auto), *document()->documentElement())) {
1617
        view->scrollToOffsetWithAnimation(layoutPos, clamping);
1618
        return;
1619
    }
1614
    view->setContentsScrollPosition(layoutPos);
1620
    view->setContentsScrollPosition(layoutPos);
1615
}
1621
}
1616
1622
- 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 595-600 syntheticEditingCommandsEnabled: a/Source/WebCore/page/Settings.yaml_sec1
595
CSSOMViewScrollingAPIEnabled:
595
CSSOMViewScrollingAPIEnabled:
596
  initial: false
596
  initial: false
597
597
598
CSSOMViewSmoothScrollingEnabled:
599
  initial: false
600
598
inputEventsEnabled:
601
inputEventsEnabled:
599
  initial: true
602
  initial: true
600
603
- a/Source/WebCore/platform/ScrollAnimation.h +3 lines
Lines 32-46 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
public:
38
public:
38
    virtual ~ScrollAnimation() { };
39
    virtual ~ScrollAnimation() { };
39
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float /* step */, float /* multiplier */) { return true; };
40
    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float /* step */, float /* multiplier */) { return true; };
41
    virtual void scroll(const FloatPoint&, ScrollClamping) { };
40
    virtual void stop() = 0;
42
    virtual void stop() = 0;
41
    virtual void updateVisibleLengths() { };
43
    virtual void updateVisibleLengths() { };
42
    virtual void setCurrentPosition(const FloatPoint&) { };
44
    virtual void setCurrentPosition(const FloatPoint&) { };
43
    virtual void serviceAnimation() { };
45
    virtual void serviceAnimation() { };
46
    virtual bool isScrollInProgress() const { return false; }
44
47
45
protected:
48
protected:
46
    ScrollAnimation(ScrollableArea& scrollableArea)
49
    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 +48 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
        FloatSize delta = position - m_currentPosition;
58
        m_currentPosition = WTFMove(position);
59
        notifyPositionChanged(delta);
60
    }))
55
{
61
{
56
}
62
}
57
63
58
ScrollAnimator::~ScrollAnimator() = default;
64
ScrollAnimator::~ScrollAnimator() = default;
59
65
66
bool ScrollAnimator::isScrollInProgress() const
67
{
68
    // FIXME (TODO): This should also take into account animations in derived classes.
69
    return m_animationProgrammaticScroll->isScrollInProgress();
70
}
71
60
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
72
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
61
{
73
{
62
    FloatPoint currentPosition = this->currentPosition();
74
    FloatPoint currentPosition = this->currentPosition();
Lines 75-80 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, a/Source/WebCore/platform/ScrollAnimator.cpp_sec3
75
    return true;
87
    return true;
76
}
88
}
77
89
90
void ScrollAnimator::scrollToOffset(const FloatPoint& offset, ScrollClamping clamping)
91
{
92
    m_animationProgrammaticScroll->setCurrentPosition(m_currentPosition);
93
    auto newPosition = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
94
    m_animationProgrammaticScroll->scroll(newPosition, clamping);
95
}
96
78
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
97
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping)
79
{
98
{
80
    FloatPoint newPositon = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
99
    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
}
264
}
246
#endif
265
#endif
247
266
267
void ScrollAnimator::cancelAnimations()
268
{
269
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
270
    m_animationProgrammaticScroll->stop();
271
#endif
272
}
273
274
void ScrollAnimator::serviceScrollAnimations()
275
{
276
#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
277
    m_animationProgrammaticScroll->serviceAnimation();
278
#endif
279
}
280
281
void ScrollAnimator::willEndLiveResize()
282
{
283
    m_animationProgrammaticScroll->updateVisibleLengths();
284
}
285
286
void ScrollAnimator::didAddVerticalScrollbar(Scrollbar*)
287
{
288
    m_animationProgrammaticScroll->updateVisibleLengths();
289
}
290
291
void ScrollAnimator::didAddHorizontalScrollbar(Scrollbar*)
292
{
293
    m_animationProgrammaticScroll->updateVisibleLengths();
294
}
295
248
} // namespace WebCore
296
} // 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 +11 lines
Lines 101-106 float ScrollableArea::adjustScrollStepForFixedContent(float step, ScrollbarOrien a/Source/WebCore/platform/ScrollableArea.cpp_sec1
101
    return step;
101
    return step;
102
}
102
}
103
103
104
bool ScrollableArea::isScrollInProgress() const
105
{
106
    return m_scrollAnimator && scrollAnimator().isScrollInProgress();
107
}
108
104
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
109
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
105
{
110
{
106
    ScrollbarOrientation orientation;
111
    ScrollbarOrientation orientation;
Lines 139-144 bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula a/Source/WebCore/platform/ScrollableArea.cpp_sec2
139
    return scrollAnimator().scroll(orientation, granularity, step, multiplier);
144
    return scrollAnimator().scroll(orientation, granularity, step, multiplier);
140
}
145
}
141
146
147
void ScrollableArea::scrollToOffsetWithAnimation(const FloatPoint& offset, ScrollClamping clamping)
148
{
149
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffset " << offset);
150
    scrollAnimator().scrollToOffset(offset, clamping);
151
}
152
142
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
153
void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollClamping clamping)
143
{
154
{
144
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
155
    LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
- a/Source/WebCore/platform/ScrollableArea.h +2 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;
65
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
66
    WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
67
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
66
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
68
    WEBCORE_EXPORT void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped);
67
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
69
    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
68
70
- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm +1 lines
Lines 1151-1156 void ScrollAnimatorMac::notifyContentAreaScrolled(const FloatSize& delta) a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm_sec1
1151
1151
1152
void ScrollAnimatorMac::cancelAnimations()
1152
void ScrollAnimatorMac::cancelAnimations()
1153
{
1153
{
1154
    ScrollAnimator::cancelAnimations();
1154
    m_haveScrolledSincePageLoad = false;
1155
    m_haveScrolledSincePageLoad = false;
1155
1156
1156
    if (scrollbarPaintTimerIsActive())
1157
    if (scrollbarPaintTimerIsActive())
- a/Source/WebCore/rendering/RenderBox.cpp +8 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
    layer()->scrollToOffsetWithAnimation(scrollPosition, clamping);
600
}
601
594
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
602
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
595
{
603
{
596
    rects.append(snappedIntRect(accumulatedOffset, size()));
604
    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 -5 / +34 lines
Lines 114-119 a/Source/WebCore/rendering/RenderLayer.cpp_sec1
114
#include "ScaleTransformOperation.h"
114
#include "ScaleTransformOperation.h"
115
#include "ScriptDisallowedScope.h"
115
#include "ScriptDisallowedScope.h"
116
#include "ScrollAnimator.h"
116
#include "ScrollAnimator.h"
117
#include "ScrollBehavior.h"
117
#include "Scrollbar.h"
118
#include "Scrollbar.h"
118
#include "ScrollbarTheme.h"
119
#include "ScrollbarTheme.h"
119
#include "ScrollingCoordinator.h"
120
#include "ScrollingCoordinator.h"
Lines 2448-2459 void RenderLayer::scrollToOffset(const ScrollOffset& scrollOffset, ScrollType sc a/Source/WebCore/rendering/RenderLayer.cpp_sec2
2448
        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(clampedScrollOffset));
2449
        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(clampedScrollOffset));
2449
#endif
2450
#endif
2450
2451
2451
    if (!handled)
2452
    bool scrollInProgress = isScrollInProgress();
2453
    if (scrollInProgress)
2454
        scrollAnimator().cancelAnimations();
2455
    if (scrollInProgress || !handled)
2452
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2456
        scrollToOffsetWithoutAnimation(clampedScrollOffset, clamping);
2453
2457
2454
    setCurrentScrollType(previousScrollType);
2458
    setCurrentScrollType(previousScrollType);
2455
}
2459
}
2456
2460
2461
void RenderLayer::scrollToOffsetWithAnimation(const ScrollOffset& scrollOffset, ScrollClamping clamping)
2462
{
2463
    ScrollOffset newScrollOffset = clamping == ScrollClamping::Clamped ? clampScrollOffset(scrollOffset) : scrollOffset;
2464
    bool scrollInProgress = isScrollInProgress();
2465
    if (scrollInProgress)
2466
        scrollAnimator().cancelAnimations();
2467
    if (scrollInProgress || newScrollOffset != this->scrollOffset())
2468
        ScrollableArea::scrollToOffsetWithAnimation(newScrollOffset, clamping);
2469
}
2470
2457
void RenderLayer::scrollTo(const ScrollPosition& position)
2471
void RenderLayer::scrollTo(const ScrollPosition& position)
2458
{
2472
{
2459
    RenderBox* box = renderBox();
2473
    RenderBox* box = renderBox();
Lines 2603-2608 bool RenderLayer::allowsCurrentScroll() const a/Source/WebCore/rendering/RenderLayer.cpp_sec3
2603
2617
2604
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2618
void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insideFixed, const ScrollRectToVisibleOptions& options)
2605
{
2619
{
2620
    // FIXME (https://webkit.org/b/189907): Make this work with nested scrollable boxes when a smooth scrolling must be performed.
2606
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2621
    LOG_WITH_STREAM(Scrolling, stream << "Layer " << this << " scrollRectToVisible " << absoluteRect);
2607
2622
2608
    RenderLayer* parentLayer = nullptr;
2623
    RenderLayer* parentLayer = nullptr;
Lines 2625-2633 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec4
2625
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2640
        LayoutRect revealRect = getRectToExpose(layerBounds, localExposeRect, insideFixed, options.alignX, options.alignY);
2626
2641
2627
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2642
        ScrollOffset clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(revealRect).location()));
2628
        if (clampedScrollOffset != scrollOffset()) {
2643
        if (isScrollInProgress() || clampedScrollOffset != scrollOffset()) {
2629
            ScrollOffset oldScrollOffset = scrollOffset();
2644
            ScrollOffset oldScrollOffset = scrollOffset();
2630
            scrollToOffset(clampedScrollOffset);
2645
            if (box->element() && useSmoothScrolling(options.behavior, *box->element()))
2646
                scrollToOffsetWithAnimation(clampedScrollOffset);
2647
            else
2648
                scrollToOffset(clampedScrollOffset);
2631
            IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2649
            IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2632
            localExposeRect.move(-scrollOffsetDifference);
2650
            localExposeRect.move(-scrollOffsetDifference);
2633
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
2651
            newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
Lines 2651-2657 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec5
2651
                IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
2669
                IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
2652
                // Adjust offsets if they're outside of the allowable range.
2670
                // Adjust offsets if they're outside of the allowable range.
2653
                scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2671
                scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
2654
                frameView.setScrollPosition(scrollOffset);
2672
                // FIXME: Should we use contentDocument()->scrollingElement()?
2673
                // See https://github.com/w3c/csswg-drafts/issues/2977
2674
                if (ownerElement->contentDocument() && ownerElement->contentDocument()->documentElement() && useSmoothScrolling(options.behavior, *ownerElement->contentDocument()->documentElement()))
2675
                    frameView.scrollToOffsetWithAnimation(scrollOffset);
2676
                else
2677
                    frameView.setScrollPosition(scrollOffset);
2655
2678
2656
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2679
                if (options.shouldAllowCrossOriginScrolling == ShouldAllowCrossOriginScrolling::Yes || frameView.safeToPropagateScrollToParent()) {
2657
                    parentLayer = ownerElement->renderer()->enclosingLayer();
2680
                    parentLayer = ownerElement->renderer()->enclosingLayer();
Lines 2685-2691 void RenderLayer::scrollRectToVisible(const LayoutRect& absoluteRect, bool insid a/Source/WebCore/rendering/RenderLayer.cpp_sec6
2685
2708
2686
            LayoutRect revealRect = getRectToExpose(viewRect, targetRect, insideFixed, options.alignX, options.alignY);
2709
            LayoutRect revealRect = getRectToExpose(viewRect, targetRect, insideFixed, options.alignX, options.alignY);
2687
            ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2710
            ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
2688
            frameView.setScrollPosition(clampedScrollPosition);
2711
            IntPoint scrollOffset(clampedScrollPosition);
2712
            // FIXME: Should we use document()->scrollingElement()?
2713
            // See https://github.com/w3c/csswg-drafts/issues/2977
2714
            if (renderer().document().documentElement() && useSmoothScrolling(options.behavior, *renderer().document().documentElement()))
2715
                frameView.scrollToOffsetWithAnimation(scrollOffset);
2716
            else
2717
                frameView.setScrollPosition(scrollOffset);
2689
2718
2690
            // This is the outermost view of a web page, so after scrolling this view we
2719
            // This is the outermost view of a web page, so after scrolling this view we
2691
            // scroll its container by calling Page::scrollRectIntoView.
2720
            // scroll its container by calling Page::scrollRectIntoView.
- a/Source/WebCore/rendering/RenderLayer.h +3 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 133-138 struct ScrollRectToVisibleOptions { a/Source/WebCore/rendering/RenderLayer.h_sec2
133
    const ScrollAlignment& alignX { ScrollAlignment::alignCenterIfNeeded };
134
    const ScrollAlignment& alignX { ScrollAlignment::alignCenterIfNeeded };
134
    const ScrollAlignment& alignY { ScrollAlignment::alignCenterIfNeeded };
135
    const ScrollAlignment& alignY { ScrollAlignment::alignCenterIfNeeded };
135
    ShouldAllowCrossOriginScrolling shouldAllowCrossOriginScrolling { ShouldAllowCrossOriginScrolling::No };
136
    ShouldAllowCrossOriginScrolling shouldAllowCrossOriginScrolling { ShouldAllowCrossOriginScrolling::No };
137
    ScrollBehavior behavior { ScrollBehavior::Auto };
136
};
138
};
137
139
138
class RenderLayer final : public ScrollableArea {
140
class RenderLayer final : public ScrollableArea {
Lines 431-436 public: a/Source/WebCore/rendering/RenderLayer.h_sec3
431
    void scrollByRecursively(const IntSize& delta, ScrollableArea** scrolledArea = nullptr);
433
    void scrollByRecursively(const IntSize& delta, ScrollableArea** scrolledArea = nullptr);
432
434
433
    WEBCORE_EXPORT void scrollToOffset(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
435
    WEBCORE_EXPORT void scrollToOffset(const ScrollOffset&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped);
436
    WEBCORE_EXPORT void scrollToOffsetWithAnimation(const ScrollOffset&, ScrollClamping = ScrollClamping::Clamped);
434
437
435
    void scrollToXPosition(int x, ScrollType, ScrollClamping = ScrollClamping::Clamped);
438
    void scrollToXPosition(int x, ScrollType, ScrollClamping = ScrollClamping::Clamped);
436
    void scrollToYPosition(int y, ScrollType, ScrollClamping = ScrollClamping::Clamped);
439
    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 1685-1690 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec3
1685
    static bool initialUseTouchOverflowScrolling() { return false; }
1689
    static bool initialUseTouchOverflowScrolling() { return false; }
1686
#endif
1690
#endif
1687
1691
1692
    static bool initialUseSmoothScrolling() { return false; }
1693
1688
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1694
    static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1689
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1695
    static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
1690
1696
- 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 1711-1717 ExceptionOr<void> Internals::unconstrainedScrollTo(Element& element, double x, d a/Source/WebCore/testing/Internals.cpp_sec1
1711
    if (!document || !document->view())
1711
    if (!document || !document->view())
1712
        return Exception { InvalidAccessError };
1712
        return Exception { InvalidAccessError };
1713
1713
1714
    element.scrollTo({ x, y }, ScrollClamping::Unclamped);
1714
    element.scrollTo(fromCoordinates(x, y), ScrollClamping::Unclamped);
1715
    return { };
1715
    return { };
1716
}
1716
}
1717
1717
- 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-06-24  Brady Eidson  <beidson@apple.com>
12
2019-06-24  Brady Eidson  <beidson@apple.com>
2
13
3
        Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
14
        Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
- a/Source/WebKit/Shared/WebPreferences.yaml -1 / +7 lines
Lines 1221-1227 ShouldDecidePolicyBeforeLoadingQuickLookPreview: a/Source/WebKit/Shared/WebPreferences.yaml_sec1
1221
#   DEFAULT_EXPERIMENTAL_FEATURES_ENABLED (for features that are ready for
1221
#   DEFAULT_EXPERIMENTAL_FEATURES_ENABLED (for features that are ready for
1222
#   wider testing).
1222
#   wider testing).
1223
1223
1224
1225
SpringTimingFunctionEnabled:
1224
SpringTimingFunctionEnabled:
1226
  type: bool
1225
  type: bool
1227
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
1226
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
Lines 1282-1287 BlockingOfSmallPluginsEnabled: a/Source/WebKit/Shared/WebPreferences.yaml_sec2
1282
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1281
  humanReadableDescription: "Stop plugins smaller than a certain threshold from loading."
1283
  category: internal
1282
  category: internal
1284
1283
1284
CSSOMViewSmoothScrollingEnabled:
1285
  type: bool
1286
  defaultValue: false
1287
  humanReadableName: "CSSOM View Smooth Scrolling"
1288
  humanReadableDescription: "Enable DOM API and CSS property for 'smooth' scroll behavior"
1289
  category: experimental
1290
1285
WebAnimationsEnabled:
1291
WebAnimationsEnabled:
1286
  type: bool
1292
  type: bool
1287
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
1293
  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
- 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-06-16  Darin Adler  <darin@apple.com>
18
2019-06-16  Darin Adler  <darin@apple.com>
2
19
3
        Rename AtomicString to AtomString
20
        Rename AtomicString to AtomString
- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h +1 lines
Lines 185-190 a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h_sec1
185
#define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
185
#define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
186
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
186
#define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
187
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
187
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
188
#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey @"WebKitCSSOMViewSmoothScrollingEnabled"
188
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
189
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
189
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
190
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
190
#define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
191
#define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm +11 lines
Lines 652-657 public: a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec1
652
#endif
652
#endif
653
653
654
        [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
654
        [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
655
        [NSNumber numberWithBool:NO], WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey,
655
        [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
656
        [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
656
        [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
657
        [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
657
#if ENABLE(MEDIA_STREAM)
658
#if ENABLE(MEDIA_STREAM)
Lines 3137-3142 static NSString *classIBCreatorID = nil; a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec2
3137
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3138
    [self _setBoolValue:flag forKey:WebKitCSSOMViewScrollingAPIEnabledPreferenceKey];
3138
}
3139
}
3139
3140
3141
- (BOOL)CSSOMViewSmoothScrollingEnabled
3142
{
3143
    return [self _boolValueForKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3144
}
3145
3146
- (void)setCSSOMViewSmoothScrollingEnabled:(BOOL)flag
3147
{
3148
    [self _setBoolValue:flag forKey:WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey];
3149
}
3150
3140
- (BOOL)webAnimationsEnabled
3151
- (BOOL)webAnimationsEnabled
3141
{
3152
{
3142
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
3153
    return [self _boolValueForKey:WebKitWebAnimationsEnabledPreferenceKey];
- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h +1 lines
Lines 614-619 extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h_sec1
614
614
615
@property (nonatomic) BOOL visualViewportAPIEnabled;
615
@property (nonatomic) BOOL visualViewportAPIEnabled;
616
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
616
@property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
617
@property (nonatomic) BOOL CSSOMViewSmoothScrollingEnabled;
617
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
618
@property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
618
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
619
@property (nonatomic) BOOL animatedImageAsyncDecodingEnabled;
619
@property (nonatomic) BOOL javaScriptMarkupEnabled;
620
@property (nonatomic) BOOL javaScriptMarkupEnabled;
- a/Source/WebKitLegacy/mac/WebView/WebView.mm +1 lines
Lines 2983-2988 static bool needsSelfRetainWhileLoadingQuirk() a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec1
2983
    settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
2983
    settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
2984
    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
2984
    settings.setSyntheticEditingCommandsEnabled([preferences syntheticEditingCommandsEnabled]);
2985
    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
2985
    settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
2986
    settings.setCSSOMViewSmoothScrollingEnabled([preferences CSSOMViewSmoothScrollingEnabled]);
2986
    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
2987
    settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
2987
2988
2988
    switch ([preferences storageBlockingPolicy]) {
2989
    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-06-16  Darin Adler  <darin@apple.com>
18
2019-06-16  Darin Adler  <darin@apple.com>
2
19
3
        Rename AtomicString to AtomString
20
        Rename AtomicString to AtomString
- 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 205-210 a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h_sec1
205
#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
205
#define WebKitServerTimingEnabledPreferenceKey "WebKitServerTimingEnabled"
206
206
207
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
207
#define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled"
208
#define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey "WebKitCSSOMViewSmoothScrollingEnabled"
208
209
209
#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
210
#define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
210
211
- a/Source/WebKitLegacy/win/WebPreferences.cpp +16 lines
Lines 333-338 void WebPreferences::initializeDefaultSettings() a/Source/WebKitLegacy/win/WebPreferences.cpp_sec1
333
333
334
    CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
334
    CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
335
335
336
    CFDictionaryAddValue(defaults, CFSTR(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey), kCFBooleanFalse);
337
336
    defaultSettings = defaults;
338
    defaultSettings = defaults;
337
}
339
}
338
340
Lines 2216-2221 HRESULT WebPreferences::setCoreMathMLEnabled(BOOL enabled) a/Source/WebKitLegacy/win/WebPreferences.cpp_sec2
2216
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2218
    setBoolValue(WebKitCoreMathMLEnabledPreferenceKey, enabled);
2217
    return S_OK;
2219
    return S_OK;
2218
}
2220
}
2221
    
2222
HRESULT WebPreferences::CSSOMViewSmoothScrollingEnabled(_Out_ BOOL* enabled)
2223
{
2224
    if (!enabled)
2225
        return E_POINTER;
2226
    *enabled = boolValueForKey(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey);
2227
    return S_OK;
2228
}
2229
2230
HRESULT WebPreferences::setCSSOMViewSmoothScrollingEnabled(BOOL enabled)
2231
{
2232
    setBoolValue(WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey, enabled);
2233
    return S_OK;
2234
}
2219
2235
2220
HRESULT WebPreferences::setApplicationId(BSTR applicationId)
2236
HRESULT WebPreferences::setApplicationId(BSTR applicationId)
2221
{
2237
{
- 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 5297-5302 HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) a/Source/WebKitLegacy/win/WebView.cpp_sec1
5297
        return hr;
5297
        return hr;
5298
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5298
    settings.setCSSOMViewScrollingAPIEnabled(!!enabled);
5299
5299
5300
    hr = prefsPrivate->CSSOMViewSmoothScrollingEnabled(&enabled);
5301
    if (FAILED(hr))
5302
        return hr;
5303
    settings.setCSSOMViewSmoothScrollingEnabled(!!enabled);
5304
5300
    hr = preferences->privateBrowsingEnabled(&enabled);
5305
    hr = preferences->privateBrowsingEnabled(&enabled);
5301
    if (FAILED(hr))
5306
    if (FAILED(hr))
5302
        return hr;
5307
        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-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
12
2019-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2
13
3
        contributors.json not canonicalized since r243297
14
        contributors.json not canonicalized since r243297
- a/Tools/DumpRenderTree/TestOptions.cpp +2 lines
Lines 117-122 TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu a/Tools/DumpRenderTree/TestOptions.cpp_sec1
117
            enableResizeObserver = parseBooleanTestHeaderValue(value);
117
            enableResizeObserver = parseBooleanTestHeaderValue(value);
118
        else if (key == "experimental:CoreMathMLEnabled")
118
        else if (key == "experimental:CoreMathMLEnabled")
119
            enableCoreMathML = parseBooleanTestHeaderValue(value);
119
            enableCoreMathML = parseBooleanTestHeaderValue(value);
120
        else if (key == "experimental:CSSOMViewSmoothScrollingEnabled")
121
            enableCSSOMViewSmoothScrolling = parseBooleanTestHeaderValue(value);
120
        pairStart = pairEnd + 1;
122
        pairStart = pairEnd + 1;
121
    }
123
    }
122
}
124
}
- a/Tools/DumpRenderTree/TestOptions.h +1 lines
Lines 48-53 struct TestOptions { a/Tools/DumpRenderTree/TestOptions.h_sec1
48
    bool adClickAttributionEnabled { false };
48
    bool adClickAttributionEnabled { false };
49
    bool enableResizeObserver { false };
49
    bool enableResizeObserver { false };
50
    bool enableCoreMathML { false };
50
    bool enableCoreMathML { false };
51
    bool enableCSSOMViewSmoothScrolling { false };
51
    std::string jscOptions;
52
    std::string jscOptions;
52
    std::string additionalSupportedImageTypes;
53
    std::string additionalSupportedImageTypes;
53
54
- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm -1 / +1 lines
Lines 1022-1027 static void setWebPreferencesForTestOptions(const TestOptions& options) a/Tools/DumpRenderTree/mac/DumpRenderTree.mm_sec1
1022
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1022
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1023
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1023
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1024
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1024
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1025
    preferences.CSSOMViewSmoothScrollingEnabled = options.enableCSSOMViewSmoothScrolling;
1025
}
1026
}
1026
1027
1027
// Called once on DumpRenderTree startup.
1028
// Called once on DumpRenderTree startup.
1028
- 

Return to Bug 188043