Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / html / adopt-parent-frame.html
blob42ba6084240644813dc36314b4971c38a18dd01e
1 <!DOCTYPE html>
2 <html>
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>
7 <script>
9 if (window.testRunner)
10 testRunner.dumpAsText();
12 function createFrame(id, parent) {
13 var iframe = document.createElement('iframe');
14 if (parent)
15 parent.contentDocument.body.appendChild(iframe);
16 else
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%';
22 return iframe;
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) {
34 try {
35 action();
36 } catch(error) {
37 if (error.name == 'HierarchyRequestError')
38 log(id, 'PASS');
39 else
40 log(id, 'FAIL: got ' + error.name + ' but expected HierarchyRequestError');
41 return;
43 log(id, 'FAIL: no exceptions thrown but expected HierarchyRequestError');
46 function adopt() {
47 testChild('child', function () { child.contentDocument.adoptNode(parent); });
48 testChild('grandchild', function () { grandchild.contentDocument.adoptNode(parent); });
51 </script>
52 </body>
53 </html>