Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(275)

Delta Between Two Patch Sets: LayoutTests/fast/dom/iframe-inner-size-scaling.html

Issue 321310043: WIP: Make window.inner{width,height} use layout viewport
Left Patch Set: Created 6 years, 8 months ago
Right Patch Set: Better fix Created 6 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « LayoutTests/ChangeLog ('k') | LayoutTests/fast/dom/window-inner-size-scaling.html » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 <!DOCTYPE html>
1 <html> 2 <html>
2 <script src="../../resources/js-test-pre.js"></script> 3 <script src="../../resources/js-test-pre.js"></script>
3 <script> 4 <script>
4 description("This tests that innerWidth/innerHeight on an frame window r eturns the size of the frame itself in CSS pixels, regardless of page scale."); 5 description("This tests that innerWidth/innerHeight on an frame window r eturns the size of the frame itself in CSS pixels, regardless of page scale.");
5 window.jsTestIsAsync = true; 6 window.jsTestIsAsync = true;
6 7
7 function runTest() { 8 function runTest() {
8 frame = document.getElementById('iframe'); 9 frame = document.getElementById('iframe');
9 originalWidth = frame.contentWindow.innerWidth; 10 originalWidth = frame.contentWindow.innerWidth;
10 originalHeight = frame.contentWindow.innerHeight; 11 originalHeight = frame.contentWindow.innerHeight;
11 12
12 if (window.internals) 13 if (window.internals)
13 window.internals.setPageScaleFactor(2, 0, 0); 14 window.internals.setPageScaleFactor(2, 0, 0);
14 15
15 shouldBeNonZero("frame.contentWindow.innerWidth"); 16 shouldBeNonZero("frame.contentWindow.innerWidth");
16 shouldBeNonZero("frame.contentWindow.innerHeight"); 17 shouldBeNonZero("frame.contentWindow.innerHeight");
17 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); 18 shouldBe("frame.contentWindow.innerWidth", "originalWidth");
18 shouldBe("frame.contentWindow.innerHeight", "originalHeight"); 19 shouldBe("frame.contentWindow.innerHeight", "originalHeight");
19 finishJSTest(); 20 finishJSTest();
20 } 21 }
21 22
22 window.onload = function() { 23 window.onload = function() {
23 // We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe. 24 // We must use setTimeout since the innerWidth/innerHeight are not yet valid for the iframe.
24 window.setTimeout(runTest, 0); 25 window.setTimeout(runTest, 0);
25 } 26 }
26 </script> 27 </script>
27 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe> 28 <body style="width: 700px; height: 500px">
28 <script src="../../resources/js-test-post.js"></script> 29 <iframe id="iframe" style="width: 100%; height: 100%;"></iframe>
30 <script src="../../resources/js-test-post.js"></script>
31 </body>
29 </html> 32 </html>
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b