Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / scroll-to-make-visible-iframe.html
blob0f168dd7d2321456984c6bc30574aa6300643ed2
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 </head>
5 <body>
7 <p id="description"></p>
9 <iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe>
11 <div id="console"></div>
13 <script>
14 description("Tests that scrolling to make an element visible successfully scrolls an iframe.");
16 if (window.testRunner)
17 testRunner.waitUntilDone();
19 window.jsTestIsAsync = true;
21 function runTest() {
22 window.frame = document.getElementById("frame");
23 window.frameWindow = frame.contentWindow;
24 window.frameDoc = frameWindow.document;
26 var upperTarget = frameDoc.getElementById("upper_target");
27 var lowerTarget = frameDoc.getElementById("lower_target");
29 if (window.accessibilityController) {
30 lowerTarget.focus();
31 var lowerTargetAccessibleObject = accessibilityController.focusedElement;
32 upperTarget.focus();
33 var upperTargetAccessibleObject = accessibilityController.focusedElement;
36 // Reset the initial scroll position (since calling focus() can scroll the page too).
37 frameWindow.scrollTo(0, 0);
38 shouldBe("frameWindow.pageYOffset", "0");
40 // Scroll to make lower target visible and check.
41 if (window.accessibilityController)
42 lowerTargetAccessibleObject.scrollToMakeVisible();
43 window.minYOffset = lowerTarget.offsetTop + lowerTarget.offsetHeight - frameWindow.innerHeight;
44 window.maxYOffset = lowerTarget.offsetTop;
45 shouldBe("frameWindow.pageYOffset >= minYOffset", "true");
46 shouldBe("frameWindow.pageYOffset <= maxYOffset", "true");
48 // Scroll to make upper target visible and check.
49 if (window.accessibilityController)
50 upperTargetAccessibleObject.scrollToMakeVisible();
51 window.minYOffset = upperTarget.offsetTop + upperTarget.offsetHeight - frameWindow.innerHeight;
52 window.maxYOffset = upperTarget.offsetTop;
53 shouldBe("frameWindow.pageYOffset >= minYOffset", "true");
54 shouldBe("frameWindow.pageYOffset <= maxYOffset", "true");
56 finishJSTest();
59 window.addEventListener('load', function() {
60 setTimeout(runTest, 10);
61 }, false);
63 </script>
65 </body>
66 </html>