OLD | NEW |
1 <!DocType HTML> | 1 <!DocType HTML> |
2 <script> | 2 <script> |
3 if (window.testRunner) | 3 if (window.testRunner) |
4 testRunner.dumpAsText(); | 4 testRunner.dumpAsText(); |
5 | 5 |
6 var iframe, iframeDoc; | 6 var iframe, iframeDoc; |
7 | 7 |
8 function log(msg) | 8 function log(msg) |
9 { | 9 { |
10 document.getElementById('logger').innerHTML += msg + '\n'; | 10 document.getElementById('logger').innerHTML += msg + '\n'; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 element.offsetLeft; | 99 element.offsetLeft; |
100 }; | 100 }; |
101 document.body.addEventListener('DOMSubtreeModified', mutationHandler, tr
ue); | 101 document.body.addEventListener('DOMSubtreeModified', mutationHandler, tr
ue); |
102 try { | 102 try { |
103 iframeDoc.body.insertBefore(element); | 103 iframeDoc.body.insertBefore(element); |
104 } catch (e) { | 104 } catch (e) { |
105 throw e; | 105 throw e; |
106 } finally { | 106 } finally { |
107 // Clear the event handler to avoid affecting the following tests. | 107 // Clear the event handler to avoid affecting the following tests. |
108 } | 108 } |
109 }); | 109 }, "TypeError"); |
110 | 110 |
111 runTest(function() { | 111 runTest(function() { |
112 iframeDoc.body.appendChild(document.createElement('div')); | 112 iframeDoc.body.appendChild(document.createElement('div')); |
113 var element = elementInCurrentDocument('appendChild'); | 113 var element = elementInCurrentDocument('appendChild'); |
114 // Make sure we don't crash if the element is moved back to the original
document during the insertBefore call. | 114 // Make sure we don't crash if the element is moved back to the original
document during the insertBefore call. |
115 var mutationHandler = function() { | 115 var mutationHandler = function() { |
116 document.body.removeEventListener('DOMSubtreeModified', mutationHand
ler, true); | 116 document.body.removeEventListener('DOMSubtreeModified', mutationHand
ler, true); |
117 document.body.appendChild(element); | 117 document.body.appendChild(element); |
118 // Access something on the element to see if it's in a valid state. | 118 // Access something on the element to see if it's in a valid state. |
119 element.offsetLeft; | 119 element.offsetLeft; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 rangeInIframe().setEndAfter(elementInCurrentDocument('setEndAfter'), 0); | 202 rangeInIframe().setEndAfter(elementInCurrentDocument('setEndAfter'), 0); |
203 }); | 203 }); |
204 runTest(function() { | 204 runTest(function() { |
205 rangeInIframe().isPointInRange(elementInCurrentDocument('isPointInRange'
), 0); | 205 rangeInIframe().isPointInRange(elementInCurrentDocument('isPointInRange'
), 0); |
206 }); | 206 }); |
207 | 207 |
208 } | 208 } |
209 </script> | 209 </script> |
210 <pre id='logger'></pre> | 210 <pre id='logger'></pre> |
211 <iframe onload='run()'></iframe> | 211 <iframe onload='run()'></iframe> |
OLD | NEW |