Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / iframe-js-url-clientWidth.html
blobc40b90a12eef5c0ddb330368a528abc74bf1e491
1 <script>
2 if (window.testRunner)
3 testRunner.dumpAsText();
5 function log(s)
7 document.getElementById('console').appendChild(document.createTextNode(s));
10 function shouldBe(a, b)
12 var evalA;
13 try {
14 evalA = eval(a)
15 } catch (e) {
16 evalA = 'Caught exception: ' + e;
19 if (evalA == b)
20 log('PASS: ' + a + ' should be ' + b + ' and is.\n');
21 else
22 log('FAIL: ' + a + ' should be ' + b + ' but instead is ' + evalA + '.\n');
24 </script>
25 <p>
26 This page tests whether an iframe correctly reports renderer-dependent values
27 when executing a javascript: load. If the test passes, you'll see a series of
28 'PASS' messages below.
29 </p>
30 <hr>
31 <pre id="console"></pre>
32 <iframe
33 name="iframe"
34 style="width: 250px; height: 250px; border: 1px solid black; background-color:red;"
35 src="javascript:
36 top.shouldBe('iframe.frameElement.clientWidth', 250);
37 top.shouldBe('iframe.frameElement.clientHeight', 250);
39 ></iframe>