1 |
wakaba |
1.1 |
<!DOCTYPE HTML> |
2 |
|
|
<title>iframe</title> |
3 |
|
|
|
4 |
|
|
<body> |
5 |
|
|
|
6 |
|
|
<p id=result class=FAIL>FAIL (noscript)</p> |
7 |
|
|
|
8 |
|
|
<p class=note>This test first creates an <code>iframe</code> element, |
9 |
|
|
inserts the element into the document, and removes the element. Then, |
10 |
|
|
it creates another <code>iframe</code> element, inserts the element |
11 |
|
|
into the document. The browsing context of the second |
12 |
|
|
<code>iframe</code> element should not be affected by the first |
13 |
|
|
element's browsing context.</p> |
14 |
|
|
|
15 |
|
|
<script> |
16 |
|
|
var result = document.getElementById ('result'); |
17 |
|
|
result.firstChild.data = 'FAIL (script)'; |
18 |
|
|
|
19 |
|
|
var iframe = document.createElement ('iframe'); |
20 |
|
|
iframe.onload = function () { |
21 |
|
|
document.body.removeChild (iframe); |
22 |
|
|
var iframe2 = document.createElement ('iframe'); |
23 |
|
|
iframe2.onload = function () { |
24 |
|
|
var href = iframe2.contentWindow.document.getElementById ('href'); |
25 |
|
|
var value = href.innerHTML; |
26 |
|
|
if (value.match (/\/remove-create-inner-2\.html$/)) { |
27 |
|
|
result.firstChild.data = 'PASS'; |
28 |
|
|
result.className = 'PASS'; |
29 |
|
|
} else if (value.match (/\/remove-create-inner-1\.html$/)) { |
30 |
|
|
result.firstChild.data = 'FAIL (old content)'; |
31 |
|
|
} else { |
32 |
|
|
result.firstChild.data = 'FAIL (' + value + ')'; |
33 |
|
|
} |
34 |
|
|
document.body.removeChild (iframe2); |
35 |
|
|
}; |
36 |
|
|
iframe2.src = 'remove-create-inner-2.html'; |
37 |
|
|
document.body.appendChild (iframe2); |
38 |
|
|
}; |
39 |
|
|
iframe.src = 'remove-create-inner-1.html'; |
40 |
|
|
document.body.appendChild (iframe); |
41 |
|
|
</script> |