Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/ongoing-smooth-scroll-anchors.html

Issue 1926473003: Smooth scroll animation should not override scroll anchoring update (MT) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable test for mac Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <script src="../../../resources/testharness.js"></script>
2 <script src="../../../resources/testharnessreport.js"></script>
3 <style>
4 body {
5 margin: 0px;
6 height: 2000px;
7 width: 2000px;
8 }
9 #changer {
10 background-color: #FF7F7F;
11 height: 10px;
12 }
13 #anchor {
14 height: 1500px;
15 background-color: #84BE6A;
16 }
17 </style>
18
19 <div id="changer"></div>
20 <div id="anchor"></div>
21
22 <script>
23 var asyncTest = async_test("Verify smooth scroll interaction with scroll anchr oing");
24
25 // The element that will change in height.
26 var ch;
27
28 // Initital scroll position.
29 var initialX = 0;
30 var initialY = 10;
31 // Amount to smooth scroll by.
32 var userScrollX = 51;
33 var userScrollY = 205;
34 // Amount to change the height of the element above the viewport.
35 var changerY = 100;
36 // End position: height of ch + userScroll.
37 var endX = 51;
38 var endY = 305;
39
40 function scrollListener() {
41 if (window.scrollX == endX && window.scrollY == endY) {
42 asyncTest.done();
43 return;
44 }
45
46 if (ch.style.height != "100")
47 ch.style.height = changerY;
48 }
49
50 window.onload = function() {
51 assert_false(!window.internals, 'This test requires internals');
52 internals.runtimeFlags.scrollAnchoringEnabled = true;
53 // Turn on smooth scrolling.
54 internals.settings.setScrollAnimatorEnabled(true);
55
56 ch = document.getElementById("changer");
57 document.getElementById('anchor').scrollIntoView();
58
59 // Smooth scroll.
60 eventSender.mouseMoveTo(100, 100);
61 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY);
62
63 asyncTest.step(function() {
64 assert_equals(window.scrollX, initialX);
65 assert_equals(window.scrollY, initialY);
66 });
67
68 document.addEventListener("scroll", scrollListener);
69 }
70 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ScrollAnchor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698