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

Unified Diff: LayoutTests/compositing/overflow/resources/update-widget-positions-on-nested-frames-and-scrollers-inner-frame.html

Issue 719813002: Ensure scrolling causes updateWidgetPositions even on nested frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: + linux expectations Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698