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>
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 <main document>.createElement';
20 el2
.innerHTML
= 'Element created via <frame document>.createElement';
22 frameDoc
.body
.appendChild(el1
);
23 frameDoc
.body
.appendChild(el2
);
28 InspectorTest
.evaluateInPage("createDynamicElements()", step1
);
30 function selectedNodeId()
32 var selectedElement
= InspectorTest
.firstElementsTreeOutline().selectedTreeElement
;
34 return "<no selected node>";
35 return selectedElement
.node().getAttribute("id");
40 InspectorTest
.evaluateInConsole("inspect(el1)", step2
);
45 InspectorTest
.runAfterPendingDispatches(step3
);
50 var id
= selectedNodeId();
51 if (id
=== "main-frame-div")
52 InspectorTest
.addResult("PASS: selected node with id '" + id
+ "'");
54 InspectorTest
.addResult("FAIL: unexpected selection " + id
);
55 InspectorTest
.evaluateInConsole("inspect(el2)", step4
);
60 InspectorTest
.runAfterPendingDispatches(step5
);
65 var id
= selectedNodeId();
66 if (id
=== "iframe-div")
67 InspectorTest
.addResult("PASS: selected node with id '" + id
+ "'");
69 InspectorTest
.addResult("FAIL: unexpected selection " + id
);
70 InspectorTest
.completeTest();
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>
82 <iframe style=
"width:400px"></iframe>