Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / first-letter-rtc-crash.html
blobff5e575a2ca5e0240c43e294a0d97202ef517bb0
1 <!DOCTYPE html>
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();
13 var aoScriptElements = document.getElementsByTagName("script");
14 for(var i = 0; i < aoScriptElements.length; i++) {
15 aoScriptElements[i].parentNode.removeChild(aoScriptElements[i]);
18 function event_DOMNodeRemoved() {
19 var oSelection = window.getSelection();
20 var oRange = oSelection.getRangeAt(47 % oSelection.rangeCount);
21 oSelection.addRange(oRange.cloneRange());
24 document.addEventListener("DOMNodeRemoved", event_DOMNodeRemoved, true);
26 var active = false;
27 function event_DOMNodeInserted() {
28 var aoElements = document.getElementsByTagName("*");
29 var oSelection=window.getSelection();
31 if (active) return ;
32 active = true;
34 var oElement = event.srcElement;
35 document.execCommand('FindString', false, 'Blarg');
36 oElement.outerHTML = "";
38 oSelection.getRangeAt(0).insertNode(aoElements[14 % aoElements.length]);
40 oSelection.deleteFromDocument();
41 active = false;
43 document.addEventListener("DOMNodeInserted", event_DOMNodeInserted, true);
45 window.onload = function() {
46 var oSelection = window.getSelection();
47 document.execCommand("SelectAll", false, false)
48 oSelection.collapseToStart();
50 oSelection.getRangeAt(0).insertNode(document.getElementById('foreignobject'));
52 var oElement = document.getElementById('rtc');
53 oElement.insertAdjacentHTML('beforeend', '<b></b><b></b>');
54 oElement.textContent = "text";
56 oSelection.getRangeAt(0).insertNode(document.getElementById('button'));
57 oSelection.getRangeAt(0).insertNode(document.createElement('b'));
59 </script>
61 <form>
62 <div>a</div>
63 </form>
65 <foreignObject id='foreignobject'></foreignObject>
66 <textarea></textarea>
68 <table>
69 <caption>
70 <ruby>
71 <button id='button'>
72 <em>
73 <textarea>AxBxC</textarea>
74 </em>
76 <rt></rt>
77 <select></select>
79 <rtc id='rtc'></rtc>
80 </button>
81 </ruby>
82 </caption>
83 </table>
84 Test passes if it does not CRASH.