layout/reftests/webcomponents/remove-insertion-point-1.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <script>
     5     function tweak() {
     6       // div with style "border: 10px solid green"
     7       var shadowDiv = document.createElement("div");
     8       shadowDiv.style.border = "10px solid green";
    10       // Insertion point will match nothing and use fallback content.
    11       var insertionPoint = document.createElement("content");
    12       shadowDiv.appendChild(insertionPoint);
    14       var shadowRoot = document.getElementById('outer').createShadowRoot();
    15       shadowRoot.appendChild(shadowDiv);
    17       // Remove the insertion point from the ShadowRoot, "Hello" should no
    18       // longer be rendered.
    19       shadowDiv.removeChild(insertionPoint);
    20     }
    21   </script>
    22 </head>
    23 <body onload="tweak()">
    24 <div id="outer">Hello</div>
    25 </body>
    26 </html>

mercurial