layout/reftests/webcomponents/fallback-content-1.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
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       // Append three nodes as children to use as fallback content.
    15       insertionPoint.innerHTML = '<span style="background-color: orange">Hello</span> <span style="background-color: green">World</span>';
    17       var shadowRoot = document.getElementById('outer').createShadowRoot();
    18       shadowRoot.appendChild(shadowDiv);
    19     }
    20   </script>
    21 </head>
    22 <body onload="tweak()">
    23 <div id="outer"></div>
    24 </body>
    25 </html>

mercurial