editor/libeditor/html/crashtests/382778-1.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <!DOCTYPE html>
     2 <html class="reftest-wait">
     3 <head>
     4 <script>
     6 function init1()
     7 {
     8   // Create an html:iframe in HTML mode (so designMode can be used 320092)
     9   targetIframe = document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
    10   targetIframe.src = "data:text/html,";
    11   targetIframe.setAttribute("style", "width: 700px; height: 500px; border: 1px dotted green;");
    12   targetIframe.addEventListener("load", init2, false);
    13   document.body.appendChild(targetIframe);
    14 }
    17 function init2()
    18 {
    19   targetWindow = targetIframe.contentWindow;
    20   targetDocument = targetWindow.document;
    22   p = document.getElementById("p");
    23   pText = p.firstChild;
    25   targetDocument.body.appendChild(targetDocument.adoptNode(p, true));
    27   targetDocument.designMode = 'on';
    29   setTimeout(boom, 0);
    30 }
    33 function boom()
    34 {
    35   var rng = targetDocument.createRange(); 
    36   rng.setStart(pText, 3);
    37   rng.setEnd(pText, 3);
    39   targetWindow.getSelection().addRange(rng); 
    41   targetDocument.execCommand("insertorderedlist", false, null);
    43   document.documentElement.removeAttribute("class")
    44 }
    46 </script>
    47 </head>
    49 <body onload="init1();">
    50 <p id="p">word word</p>
    51 </body>
    53 </html>

mercurial