Index: LayoutTests/compositing/overflow/resources/update-widget-positions-on-nested-frames-and-scrollers-inner-frame.html |
diff --git a/LayoutTests/compositing/overflow/resources/update-widget-positions-on-nested-frames-and-scrollers-inner-frame.html b/LayoutTests/compositing/overflow/resources/update-widget-positions-on-nested-frames-and-scrollers-inner-frame.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5487b36beb8768373f213f2cf9b4756d81bccc48 |
--- /dev/null |
+++ b/LayoutTests/compositing/overflow/resources/update-widget-positions-on-nested-frames-and-scrollers-inner-frame.html |
@@ -0,0 +1,68 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <style> |
+ select { |
+ display: block; |
+ margin: 5px; |
+ } |
+ </style> |
+ <script> |
+ // We need to 'click' the select element by sending an actual event |
+ // through internals, since the regular javascript click() method |
+ // won't trigger the right events for this test. |
+ function clickSelect() { |
+ if (!window.eventSender) |
+ return; |
+ |
+ var select = document.getElementById('select'); |
+ // FIXME: it would be really nice to use getBoundingClientRect() and not |
+ // hard-code pixel coordinates here, but since it's in an iframe, the |
+ // coordinates are translated anyway. |
+ eventSender.mouseMoveTo(50, 120); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+ |
+ // We'll get a message from the outer frame when it's done scrolling, |
+ // so we know it's time to click on a select element. |
+ window.onmessage = function() { |
+ clickSelect(); |
+ |
+ if (window.testRunner) |
+ window.setTimeout(function() { window.testRunner.notifyDone(); }, 0); |
+ }; |
+ |
+ // This function just saves us from hard-coding 30 select elements |
+ // (each with a few option elements) in the body. One of the |
+ // select elements near the bottom is given an id so we can click |
+ // on it later. |
+ function populateDom() { |
+ for (var x = 0; x < 30; x++) { |
+ var select = document.createElement('select'); |
+ for (var y = 0; y < 4; ++y) { |
+ var option = document.createElement('option'); |
+ option.innerText = y; |
+ select.appendChild(option); |
+ } |
+ |
+ if (x == 24) { |
+ select.id = 'select'; |
+ } |
+ |
+ document.body.appendChild(select); |
+ } |
+ } |
+ |
+ // Javascript execution starts here. This will populate the iframe |
+ // with a bunch of select elements, then post a message to the |
+ // outer iframe to tell it to scroll. |
+ window.onload = function() { |
+ populateDom(); |
+ parent.postMessage('', '*'); |
+ }; |
+ </script> |
+</head> |
+ |
+<body> |
+</body> |