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

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: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: initial + scroll + changer
37 var endX = 51;
38 var endY = 305;
ajuma 2016/04/27 15:46:10 Should this be 315 (by the math from the comment a
ymalik 2016/04/27 16:21:38 The comment is wrong. Fixed.
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 // Turn on smooth scrolling.
52 internals.settings.setScrollAnimatorEnabled(true);
53
54 ch = document.getElementById("changer");
55 document.getElementById('anchor').scrollIntoView();
56
57 // Smooth scroll.
58 eventSender.mouseMoveTo(100, 100);
59 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY);
60
61 asyncTest.step(function() {
62 assert_equals(window.scrollX, initialX);
63 assert_equals(window.scrollY, initialY);
64 });
65
66 document.addEventListener("scroll", scrollListener);
67 }
68 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698