layout/reftests/webcomponents/cross-tree-selection-1.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!DOCTYPE HTML>
     2 <html class="reftest-wait">
     3 <head>
     4   <script>
     5     function tweak() {
     6       var host = document.getElementById("host");
     7       var shadow = host.createShadowRoot();
     9       var textNode = document.createTextNode(" World");
    10       shadow.appendChild(textNode);
    12       // Create a selection with focus preceeding anchor
    13       var selection = window.getSelection();
    14       var range = document.createRange();
    15       range.setStart(shadow, 1);
    16       range.setEnd(shadow, 1);
    17       selection.addRange(range);
    18       selection.extend(shadow, 0);
    20       // Extend selection into a different node tree
    21       // (from ShadowRoot into the previous node in the parent node tree).
    22       setTimeout(function() {
    23         selection.extend(document.getElementById("previous"), 0);
    24         document.documentElement.className = '';
    25       }, 100);
    26     }
    27   </script>
    28 </head>
    29 <body onload="tweak()">
    30 <span id="previous">Hello</span><span id="host"></span>
    31 </body>
    32 </html>

mercurial