Chromium Code Reviews| Index: LayoutTests/fast/events/panScroll-nested-divs-forbidden.html |
| diff --git a/LayoutTests/fast/events/panScroll-nested-divs-forbidden.html b/LayoutTests/fast/events/panScroll-nested-divs-forbidden.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9955f5d673e46753b7a5a017dca27639e5495907 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/panScroll-nested-divs-forbidden.html |
| @@ -0,0 +1,81 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<style type="text/css"> |
| +div { |
| + line-height: 50px; |
| +} |
| +#outerdiv { |
| + overflow:auto; |
| + border: 2px solid #000FFF; |
| +} |
| +#innerdiv { |
| + overflow:auto; |
| + border: 2px solid #000000; |
| + width: 120%; |
| + padding: 5px; |
| +} |
| +</style> |
| +<script> |
| +function $(id) { return document.getElementById(id); } |
| +var outerdiv; |
| + |
| +function testIt() { |
| + outerdiv = $('outerdiv'); |
| + var retryCount = 0; |
| + |
| + // Attempt a digonal pan scroll originating in the inner div. |
| + eventSender.mouseMoveTo(150, 150); |
| + eventSender.mouseDown(1); |
| + eventSender.mouseUp(1); |
| + eventSender.mouseMoveTo(225, 75); |
| + |
| + function checkScrolled() |
| + { |
| + ++retryCount; |
| + if (outerdiv.scrollLeft || retryCount > 10) { |
| + finishTest(); |
| + return; |
| + } |
| + |
| + window.setTimeout(checkScrolled, 50); |
|
jamesr
2013/05/28 22:26:11
what is this delay for?
yosin_UTC9
2013/05/29 08:15:52
I think 50ms comes from Autscroll timer interval.
|
| + } |
| + |
| + function finishTest() { |
| + shouldNotBe('outerdiv.scrollLeft', '0'); |
| + shouldBeZero('outerdiv.scrollTop'); |
| + testRunner.notifyDone(); |
| + } |
| + |
| + checkScrolled(); |
| +} |
| + |
| +function setUpTest() |
| +{ |
| + if (!window.eventSender) { |
| + console.log('Please run within DumpRenderTree.'); |
| + return; |
| + } |
| + |
| + window.jsTestIsAsync = true; |
| + window.setTimeout(testIt, 0); |
|
jamesr
2013/05/28 22:26:11
what is this timeout for?
yosin_UTC9
2013/05/29 08:15:52
It is better to use 'load' event rather than timeo
tdanderson
2013/05/29 17:57:32
Done.
|
| +} |
| +</script> |
| +</head> |
| +<body> |
| +<div id="outerdiv"> |
| + <p>Top of outer div.</p> |
| + <div id="innerdiv"> |
| + <p>Inner div.</p> |
| + </div> |
| + <p>Bottom of outer div.</p> |
| +</div> |
| +<p>Test for <a href="http://crbug.com/232965">bug 232965</a> This tests that vertical pan scrolling does not propagate from the inner div to the outer div when the outer div has no vertical overflow.</p> |
| +<div id="console"></div> |
| +<script src="../js/resources/js-test-pre.js"></script> |
| +<script> |
| +setUpTest(); |
| +</script> |
| +<script src="../js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |