3 <body onload=
"adopt()">
4 <p>This tests adopting a parent iframe (i.e. the iframe contains the document into which iframe is adopted). WebKit should not hang and should throw a hierarchy request exception.
</p>
5 <div>Adopting parent frame:
<span id=
"child"></span></div>
6 <div>Adopting grandparent frame:
<span id=
"grandchild"></span></div>
10 testRunner
.dumpAsText();
12 function createFrame(id
, parent
) {
13 var iframe
= document
.createElement('iframe');
15 parent
.contentDocument
.body
.appendChild(iframe
);
17 document
.body
.appendChild(iframe
);
18 iframe
.contentDocument
.body
.appendChild(iframe
.contentDocument
.createTextNode(id
));
19 iframe
.contentDocument
.body
.appendChild(iframe
.contentDocument
.createElement('br'));
20 iframe
.style
.width
= '70%';
21 iframe
.style
.height
= '40%';
25 var parent
= createFrame('parent');
26 var child
= createFrame('child', parent
);
27 var grandchild
= createFrame('grandchild', child
);
29 function log(id
, message
) {
30 document
.getElementById(id
).innerHTML
= message
;
33 function testChild(id
, action
) {
37 if (error
.name
== 'HierarchyRequestError')
40 log(id
, 'FAIL: got ' + error
.name
+ ' but expected HierarchyRequestError');
43 log(id
, 'FAIL: no exceptions thrown but expected HierarchyRequestError');
47 testChild('child', function () { child
.contentDocument
.adoptNode(parent
); });
48 testChild('grandchild', function () { grandchild
.contentDocument
.adoptNode(parent
); });