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

Side by Side Diff: LayoutTests/accessibility/scroll-to-make-visible-div-overflow.html

Issue 1118753004: Fix another case where scrollToMakeVisible was off. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: null-check scrollParent Created 5 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 | LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../resources/js-test.js"></script> 3 <script src="../resources/js-test.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 6
7 <p id="description"></p> 7 <p id="description"></p>
8 8
9 <div id="container" style="height: 100px; overflow: scroll"> 9 <div id="container" style="height: 100px; overflow: scroll">
10 <button id="upper_target">Upper Target</button> 10 <button id="upper_target">Upper Target</button>
(...skipping 24 matching lines...) Expand all
35 35
36 // Scroll to make lower target visible and check. 36 // Scroll to make lower target visible and check.
37 if (window.accessibilityController) 37 if (window.accessibilityController)
38 lowerTargetAccessibleObject.scrollToMakeVisible(); 38 lowerTargetAccessibleObject.scrollToMakeVisible();
39 var top = lowerTarget.offsetTop - container.offsetTop; 39 var top = lowerTarget.offsetTop - container.offsetTop;
40 window.minYOffset = top + lowerTarget.offsetHeight - container.offsetHeight; 40 window.minYOffset = top + lowerTarget.offsetHeight - container.offsetHeight;
41 window.maxYOffset = top; 41 window.maxYOffset = top;
42 shouldBe("container.scrollTop >= minYOffset", "true"); 42 shouldBe("container.scrollTop >= minYOffset", "true");
43 shouldBe("container.scrollTop <= maxYOffset", "true"); 43 shouldBe("container.scrollTop <= maxYOffset", "true");
44 44
45 // Do it again. It shouldn't scroll.
46 if (window.accessibilityController)
47 lowerTargetAccessibleObject.scrollToMakeVisible();
48 var top = lowerTarget.offsetTop - container.offsetTop;
49 window.minYOffset = top + lowerTarget.offsetHeight - container.offsetHeight;
50 window.maxYOffset = top;
51 shouldBe("container.scrollTop >= minYOffset", "true");
52 shouldBe("container.scrollTop <= maxYOffset", "true");
53
45 // Scroll to make upper target visible and check. 54 // Scroll to make upper target visible and check.
46 if (window.accessibilityController) 55 if (window.accessibilityController)
47 upperTargetAccessibleObject.scrollToMakeVisible(); 56 upperTargetAccessibleObject.scrollToMakeVisible();
48 top = upperTarget.offsetTop - container.offsetTop; 57 top = upperTarget.offsetTop - container.offsetTop;
49 window.minYOffset = top + upperTarget.offsetHeight - container.offsetHeight; 58 window.minYOffset = top + upperTarget.offsetHeight - container.offsetHeight;
50 window.maxYOffset = top; 59 window.maxYOffset = top;
51 shouldBe("container.scrollTop >= minYOffset", "true"); 60 shouldBe("container.scrollTop >= minYOffset", "true");
52 shouldBe("container.scrollTop <= maxYOffset", "true"); 61 shouldBe("container.scrollTop <= maxYOffset", "true");
53 62
54 finishJSTest(); 63 finishJSTest();
55 } 64 }
56 65
57 runTest(); 66 runTest();
58 67
59 </script> 68 </script>
60 69
61 </body> 70 </body>
62 </html> 71 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698