forked from burg/timelapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles-iframe.html
53 lines (44 loc) · 1.22 KB
/
styles-iframe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<head>
<style type="text/css" media="screen">
#main { background:blue; }
</style>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>
function loadIframe()
{
var iframe = document.createElement("iframe");
iframe.src = "resources/styles-iframe-data.html";
document.getElementById("main").appendChild(iframe);
}
function test()
{
InspectorTest.evaluateInPage("loadIframe()");
InspectorTest.addConsoleSniffer(step0);
function step0()
{
InspectorTest.selectNodeAndWaitForStyles("main", step1);
}
function step1()
{
InspectorTest.addResult("Main frame style:");
InspectorTest.dumpSelectedElementStyles(true, false, true);
InspectorTest.selectNodeAndWaitForStyles("iframeBody", step2);
}
function step2()
{
InspectorTest.addResult("iframe style:");
InspectorTest.dumpSelectedElementStyles(true, false, true);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that proper (and different) styles are returned for body elements of main document and iframe.
</p>
<div id="main"></div>
</body>
</html>