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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } catch (e) { | 124 } catch (e) { |
125 throw e; | 125 throw e; |
126 } finally { | 126 } finally { |
127 // Clear the event handler to avoid affecting the following tests. | 127 // Clear the event handler to avoid affecting the following tests. |
128 } | 128 } |
129 }); | 129 }); |
130 | 130 |
131 runTest(function() { | 131 runTest(function() { |
132 iframeDoc.body.appendChild(document.createElement('div')); | 132 iframeDoc.body.appendChild(document.createElement('div')); |
133 var element = elementInCurrentDocument('replaceChild'); | 133 var element = elementInCurrentDocument('replaceChild'); |
134 // Make sure we don't crash if the element is moved back to the original
document during the insertBefore call. | 134 // Make sure we don't crash if the element is moved back to the original |
| 135 // document during the replaceChild call. |
135 var mutationHandler = function() { | 136 var mutationHandler = function() { |
136 document.body.removeEventListener('DOMSubtreeModified', mutationHand
ler, true); | 137 document.body.removeEventListener('DOMSubtreeModified', mutationHand
ler, true); |
137 document.body.appendChild(element); | 138 document.body.appendChild(element); |
138 // Access something on the element to see if it's in a valid state. | 139 // Access something on the element to see if it's in a valid state. |
139 element.offsetLeft; | 140 element.offsetLeft; |
140 }; | 141 }; |
141 document.body.addEventListener('DOMSubtreeModified', mutationHandler, tr
ue); | 142 document.body.addEventListener('DOMSubtreeModified', mutationHandler, tr
ue); |
142 try { | 143 try { |
143 iframeDoc.body.replaceChild(element, iframeDoc.body.firstChild); | 144 iframeDoc.body.replaceChild(element, iframeDoc.body.firstChild); |
144 } catch (e) { | 145 } catch (e) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 rangeInIframe().setEndAfter(elementInCurrentDocument('setEndAfter'), 0); | 203 rangeInIframe().setEndAfter(elementInCurrentDocument('setEndAfter'), 0); |
203 }); | 204 }); |
204 runTest(function() { | 205 runTest(function() { |
205 rangeInIframe().isPointInRange(elementInCurrentDocument('isPointInRange'
), 0); | 206 rangeInIframe().isPointInRange(elementInCurrentDocument('isPointInRange'
), 0); |
206 }); | 207 }); |
207 | 208 |
208 } | 209 } |
209 </script> | 210 </script> |
210 <pre id='logger'></pre> | 211 <pre id='logger'></pre> |
211 <iframe onload='run()'></iframe> | 212 <iframe onload='run()'></iframe> |
OLD | NEW |