| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <style> | |
| 4 textarea { visibility: hidden; } | |
| 5 button:optional, textarea:optional { display: block; } | |
| 6 div:first-letter { color: red; } | |
| 7 form:read-only { visibility: inherit; } | |
| 8 </style> | |
| 9 <script> | |
| 10 if (window.testRunner) | |
| 11 testRunner.dumpAsText(); | |
| 12 | |
| 13 var aoScriptElements = document.getElementsByTagName("script"); | |
| 14 for(var i = 0; i < aoScriptElements.length; i++) { | |
| 15 aoScriptElements[i].parentNode.removeChild(aoScriptElements[i]); | |
| 16 } | |
| 17 | |
| 18 function event_DOMNodeRemoved() { | |
| 19 var oSelection = window.getSelection(); | |
| 20 var oRange = oSelection.getRangeAt(47 % oSelection.rangeCount); | |
| 21 oSelection.addRange(oRange.cloneRange()); | |
| 22 | |
| 23 } | |
| 24 document.addEventListener("DOMNodeRemoved", event_DOMNodeRemoved, true); | |
| 25 | |
| 26 var active = false; | |
| 27 function event_DOMNodeInserted() { | |
| 28 var aoElements = document.getElementsByTagName("*"); | |
| 29 var oSelection=window.getSelection(); | |
| 30 | |
| 31 if (active) return ; | |
| 32 active = true; | |
| 33 | |
| 34 var oElement = event.srcElement; | |
| 35 document.execCommand('FindString', false, 'Blarg'); | |
| 36 oElement.outerHTML = ""; | |
| 37 | |
| 38 oSelection.getRangeAt(0).insertNode(aoElements[14 % aoElements.length]); | |
| 39 | |
| 40 oSelection.deleteFromDocument(); | |
| 41 active = false; | |
| 42 } | |
| 43 document.addEventListener("DOMNodeInserted", event_DOMNodeInserted, true); | |
| 44 | |
| 45 window.onload = function() { | |
| 46 var oSelection = window.getSelection(); | |
| 47 document.execCommand("SelectAll", false, false) | |
| 48 oSelection.collapseToStart(); | |
| 49 | |
| 50 oSelection.getRangeAt(0).insertNode(document.getElementById('foreignobject')); | |
| 51 | |
| 52 var oElement = document.getElementById('rtc'); | |
| 53 oElement.insertAdjacentHTML('beforeend', '<b></b><b></b>'); | |
| 54 oElement.textContent = "text"; | |
| 55 | |
| 56 oSelection.getRangeAt(0).insertNode(document.getElementById('button')); | |
| 57 oSelection.getRangeAt(0).insertNode(document.createElement('b')); | |
| 58 } | |
| 59 </script> | |
| 60 | |
| 61 <form> | |
| 62 <div>a</div> | |
| 63 </form> | |
| 64 | |
| 65 <foreignObject id='foreignobject'></foreignObject> | |
| 66 <textarea></textarea> | |
| 67 | |
| 68 <table> | |
| 69 <caption> | |
| 70 <ruby> | |
| 71 <button id='button'> | |
| 72 <em> | |
| 73 <textarea>AxBxC</textarea> | |
| 74 </em> | |
| 75 | |
| 76 <rt></rt> | |
| 77 <select></select> | |
| 78 | |
| 79 <rtc id='rtc'></rtc> | |
| 80 </button> | |
| 81 </ruby> | |
| 82 </caption> | |
| 83 </table> | |
| 84 Test passes if it does not CRASH. | |
| OLD | NEW |