Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / elements-inspect-iframe-from-different-domain.html
blob707154824992b84f65bfa1b7224e91b6ab2e9396
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script src="../../http/tests/inspector/elements-test.js"></script>
6 <script>
7 var el1;
8 var el2;
9 function createDynamicElements()
11 var mainDoc = document;
12 var frameDoc = window.frames[0].document;
14 el1 = mainDoc.createElement('div');
15 el1.id = "main-frame-div";
16 el2 = frameDoc.createElement('div');
17 el2.id = "iframe-div";
19 el1.innerHTML = 'Element created via &lt;main document>.createElement';
20 el2.innerHTML = 'Element created via &lt;frame document>.createElement';
22 frameDoc.body.appendChild(el1);
23 frameDoc.body.appendChild(el2);
26 function test()
28 InspectorTest.evaluateInPage("createDynamicElements()", step1);
30 function selectedNodeId()
32 var selectedElement = InspectorTest.firstElementsTreeOutline().selectedTreeElement;
33 if (!selectedElement)
34 return "<no selected node>";
35 return selectedElement.node().getAttribute("id");
38 function step1()
40 InspectorTest.evaluateInConsole("inspect(el1)", step2);
43 function step2()
45 InspectorTest.runAfterPendingDispatches(step3);
48 function step3()
50 var id = selectedNodeId();
51 if (id === "main-frame-div")
52 InspectorTest.addResult("PASS: selected node with id '" + id + "'");
53 else
54 InspectorTest.addResult("FAIL: unexpected selection " + id);
55 InspectorTest.evaluateInConsole("inspect(el2)", step4);
58 function step4()
60 InspectorTest.runAfterPendingDispatches(step5);
63 function step5()
65 var id = selectedNodeId();
66 if (id === "iframe-div")
67 InspectorTest.addResult("PASS: selected node with id '" + id + "'");
68 else
69 InspectorTest.addResult("FAIL: unexpected selection " + id);
70 InspectorTest.completeTest();
74 </script>
75 </head>
77 <body onload="runTest()">
78 <p>Test that web inspector can select element in an iframe even if the element was created
79 via <code>createElement</code> of <code>document</code> other than iframe's <code>document</code>.
80 <a href="https://bugs.webkit.org/show_bug.cgi?id=60031">Bug 60031</a>
81 </p>
82 <iframe style="width:400px"></iframe>
83 </body>
84 </html>