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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-body.html

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos Created 5 years, 2 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 <!DOCTYPE html>
2 <style>
3 body {
4 width: 800px;
5 height: 800px;
6 overflow-y: hidden;
7 }
8
9 #text-wrapper {
10 padding: 20px;
11 overflow-y: scroll;
12 background-color:#ccc;
13 height: 40px;
14 width: 100px;
15 }
16 </style>
17 <script src="../../resources/js-test.js"></script>
18 <script type="text/javascript">
19 var scrollTopBefore;
20 var maxScrollLeft;
21
22 setPrintTestResultsLazily();
23 jsTestIsAsync = true;
24 description("This test ensures that if an autoscroll starts from within a " +
25 "scrollable div, it does not propagate to its non-scrollabe document " +
26 "body. Furthermore, it tests that if the body has only one of overflowX " +
27 "or overflowY set to hidden, the scrollable axis actually scrolls. Note " +
28 "that this test is pertaining to crbug.com/531525.");
29
30 function finishTest() {
31 eventSender.mouseUp();
32 // Because only overflowY:hidden is set, horizontal scroll should happen and
33 // vertical scroll shouldn't.
34 if (document.scrollingElement.scrollTop == scrollTopBefore && document.scrol lingElement.scrollLeft == maxScrollLeft) {
35 testPassed("Document didn't scroll.");
36 } else {
37 testFailed("Document scrolled although overflow:hidden.");
38 testFailed(document.scrollingElement.scrollTop + " " + scrollTopBefore + " " + document.scrollingElement.scrollLeft + " " + maxScrollLeft);
39 }
40 document.getElementById('text-wrapper').style.display = 'none';
41 finishJSTest();
42 }
43
44 window.onload = function () {
45 scrollTopBefore = document.scrollingElement.scrollTop;
46 maxScrollLeft = document.scrollingElement.scrollWidth - window.innerWidth;
47
48 var element = document.getElementById('select');
49 var x = element.offsetLeft + 7;
50 var y = element.offsetTop + 7;
51 eventSender.dragMode = false;
52 eventSender.mouseMoveTo(x, y);
53 eventSender.mouseDown();
54 eventSender.mouseMoveTo(x + 795, y);
55 eventSender.mouseMoveTo(x + 795, y + 795);
56 window.requestAnimationFrame(finishTest);
57 }
58 </script>
59
60 <div id="text-wrapper">
61 <span id="select">This text could be anything but should be long enough to be scrollable.</span>
62 </div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698