content/xml/tests/load/load.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.

michael@0 1 <html>
michael@0 2 <head>
michael@0 3 <title>Synchronized document.load() test</title>
michael@0 4 <style type="text/css">
michael@0 5 .box {
michael@0 6 display: box;
michael@0 7 border: 1px solid black;
michael@0 8 margin-bottom: 0.5em;
michael@0 9 }
michael@0 10 .boxheader {
michael@0 11 font-weight: bold;
michael@0 12 color: maroon;
michael@0 13 }
michael@0 14 pre {
michael@0 15 margin-left: 2em;
michael@0 16 }
michael@0 17 </style>
michael@0 18 <script type="text/javascript">
michael@0 19 var xmlDoc = document.implementation.createDocument("", "test", null);
michael@0 20
michael@0 21 function documentLoaded(e) {
michael@0 22 var s = new XMLSerializer();
michael@0 23 var str = s.serializeToString(xmlDoc);
michael@0 24 document.getElementById("id1").firstChild.nodeValue = str;
michael@0 25 var eventProperties = "";
michael@0 26 for (prop in e) {
michael@0 27 eventProperties += prop + " : '" + e[prop] + "'\n";
michael@0 28 }
michael@0 29 document.getElementById("id2").firstChild.nodeValue =
michael@0 30 "Event object: " + e + "\n" +
michael@0 31 "Event properties:\n" +
michael@0 32 eventProperties;
michael@0 33 }
michael@0 34
michael@0 35 xmlDoc.addEventListener("load", documentLoaded, false);
michael@0 36
michael@0 37 function execute()
michael@0 38 {
michael@0 39 xmlDoc.load("test.xml");
michael@0 40 }
michael@0 41
michael@0 42 </script>
michael@0 43 </head>
michael@0 44 <body onload="execute();">
michael@0 45 <h1>Synchronized document.load() test</h1>
michael@0 46
michael@0 47 <div class="box"><span class="boxheader">XML document serialized</span>
michael@0 48 <pre id="id1">@@No result@@</pre>
michael@0 49 </div>
michael@0 50 <div class="box"><span class="boxheader">Event information</span>
michael@0 51 <pre id="id2">@@No result@@</pre>
michael@0 52 </div>
michael@0 53
michael@0 54 </body>
michael@0 55 </body>
michael@0 56 </html>

mercurial