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

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

Issue 2015113003: Correctly update scroll offset animations in response to scroll anchoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 6 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
1 <script src="../../../resources/testharness.js"></script> 1 <script src="../../../resources/testharness.js"></script>
2 <script src="../../../resources/testharnessreport.js"></script> 2 <script src="../../../resources/testharnessreport.js"></script>
3 <style> 3 <style>
4 html {
5 -webkit-writing-mode: vertical-rl;
6 }
4 body { 7 body {
5 margin: 0px; 8 margin: 0px;
6 height: 2000px; 9 height: 2000px;
7 width: 2000px; 10 width: 2000px;
8 } 11 }
9 #changer { 12 #changer {
10 background-color: #FF7F7F; 13 background-color: #FF7F7F;
11 height: 10px; 14 width: 0px;
12 } 15 }
13 #anchor { 16 #anchor {
14 height: 1500px; 17 width: 1500px;
15 background-color: #84BE6A; 18 background-color: #84BE6A;
16 } 19 }
17 </style> 20 </style>
18 21
19 <div id="changer"></div> 22 <div id="changer"></div>
20 <div id="anchor"></div> 23 <div id="anchor"></div>
21 24
22 <script> 25 <script>
23 var asyncTest = async_test("Verify smooth scroll interaction with scroll anchr oing"); 26 var asyncTest = async_test("Verify smooth scroll interaction with scroll anchr oing on page with vertical-lr writing mode");
24 27
25 // The element that will change in height. 28 // The element that will change in height.
26 var ch; 29 var ch;
27
28 // Initital scroll position.
29 var initialX = 0;
30 var initialY = 10;
31 // Amount to smooth scroll by. 30 // Amount to smooth scroll by.
32 var userScrollX = 51; 31 var userScrollX = -205;
33 var userScrollY = 205; 32 var userScrollY = 51;
34 // Amount to change the height of the element above the viewport. 33 // Amount to change the height of the element above the viewport.
35 var changerY = 100; 34 var changerX = 100;
36 // End position: height of ch + userScroll. 35 // End position: height of ch + userScroll.
37 var endX = 51; 36 var endX = -305;
38 var endY = 305; 37 var endY = 51;
39 38
40 function scrollListener() { 39 function scrollListener() {
41 if (window.scrollX == endX && window.scrollY == endY) { 40 if (window.scrollX == endX && window.scrollY == endY) {
42 asyncTest.done(); 41 asyncTest.done();
43 return; 42 return;
44 } 43 }
45 44
46 if (ch.style.height != "100") 45 if (ch.style.width != "100")
47 ch.style.height = changerY; 46 ch.style.width = changerX;
48 } 47 }
49 48
50 window.onload = function() { 49 window.onload = function() {
51 assert_false(!window.internals, 'This test requires internals'); 50 assert_false(!window.internals, 'This test requires internals');
52 internals.runtimeFlags.scrollAnchoringEnabled = true; 51 internals.runtimeFlags.scrollAnchoringEnabled = true;
53 // Turn on smooth scrolling. 52 // Turn on smooth scrolling.
54 internals.settings.setScrollAnimatorEnabled(true); 53 internals.settings.setScrollAnimatorEnabled(true);
55 54
56 ch = document.getElementById("changer"); 55 ch = document.getElementById("changer");
57 document.getElementById('anchor').scrollIntoView();
58 56
59 // Smooth scroll. 57 // Smooth scroll.
60 eventSender.mouseMoveTo(100, 100); 58 eventSender.mouseMoveTo(100, 100);
61 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY); 59 eventSender.continuousMouseScrollBy(-userScrollX, -userScrollY);
62 60
63 asyncTest.step(function() {
64 assert_equals(window.scrollX, initialX);
65 assert_equals(window.scrollY, initialY);
66 });
67
68 document.addEventListener("scroll", scrollListener); 61 document.addEventListener("scroll", scrollListener);
69 } 62 }
70 </script> 63 </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