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

Side by Side Diff: LayoutTests/http/tests/navigation/resources/frame-with-anchor-cross-origin.html

Issue 26472003: Fix improper scrollTop/Left usage in LayoutTests/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@issue_304768
Patch Set: Fix improper scrollTop/Left usage in LayoutTests/ Created 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../js-test-resources/js-test-pre.js"></script> 4 <script src="../../../js-test-resources/js-test-pre.js"></script>
5 <script> 5 <script>
6 function runTest() { 6 function runTest() {
7 description('Tests that loading a cross-origin frame with a URL that conta ins an anchor fragment does not scroll this frame.'); 7 description('Tests that loading a cross-origin frame with a URL that conta ins an anchor fragment does not scroll this frame.');
8 description('This prevents a cross-origin information leak sometimes know as framesniffing.'); 8 description('This prevents a cross-origin information leak sometimes know as framesniffing.');
9 // Check scroll position in a timeout to make sure that the anchor has not been scrolled to. 9 // Check scroll position in a timeout to make sure that the anchor has not been scrolled to.
10 setTimeout(function() { 10 setTimeout(function() {
11 shouldBeTrue('document.body.scrollTop == 0'); 11 shouldBeTrue('document.documentElement.scrollTop == 0');
12 shouldBeTrue('document.body.scrollLeft == 0'); 12 shouldBeTrue('document.documentElement.scrollLeft == 0');
13 finishJSTest(); 13 finishJSTest();
14 }, 0); 14 }, 0);
15 } 15 }
16 var jsTestIsAsync = true; 16 var jsTestIsAsync = true;
17 </script> 17 </script>
18 </head> 18 </head>
19 <body> 19 <body>
20 <!-- large cross-origin grandchild frame --> 20 <!-- large cross-origin grandchild frame -->
21 <iframe height="8000" width="8000" src="http://localhost:8000/navigation/resourc es/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()"> 21 <iframe height="8000" width="8000" src="http://localhost:8000/navigation/resourc es/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()">
22 </iframe> 22 </iframe>
23 <script src="../../../js-test-resources/js-test-post.js"></script> 23 <script src="../../../js-test-resources/js-test-post.js"></script>
24 </body> 24 </body>
25 </html> 25 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698