Tue, 06 Jan 2015 21:39:09 +0100
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 | <SCRIPT> |
michael@0 | 4 | function docFragAppendTest() { |
michael@0 | 5 | var d = document.createDocumentFragment(); |
michael@0 | 6 | d.appendChild(document.createTextNode(" Hello")); |
michael@0 | 7 | var b = document.createElement("B") |
michael@0 | 8 | b.appendChild(document.createTextNode(" there")); |
michael@0 | 9 | d.appendChild(b); |
michael@0 | 10 | p = document.getElementById("appendTest"); |
michael@0 | 11 | p.appendChild(d); |
michael@0 | 12 | alert("This number should be 0: " + d.childNodes.length); |
michael@0 | 13 | } |
michael@0 | 14 | function docFragReplaceTest() { |
michael@0 | 15 | var d = document.createDocumentFragment(); |
michael@0 | 16 | d.appendChild(document.createTextNode(" new")); |
michael@0 | 17 | var b = document.createElement("B") |
michael@0 | 18 | b.appendChild(document.createTextNode(" ones")); |
michael@0 | 19 | d.appendChild(b); |
michael@0 | 20 | p = document.getElementById("replaceTest"); |
michael@0 | 21 | s = document.getElementById("replaceSpan"); |
michael@0 | 22 | if (null != s) { |
michael@0 | 23 | p.replaceChild(d, s); |
michael@0 | 24 | } |
michael@0 | 25 | alert("This number should be 0: " + d.childNodes.length); |
michael@0 | 26 | } |
michael@0 | 27 | </SCRIPT> |
michael@0 | 28 | </HEAD> |
michael@0 | 29 | <BODY> |
michael@0 | 30 | <H1>Document Fragment test</H1> |
michael@0 | 31 | |
michael@0 | 32 | <P ID="appendTest">If this test works, clicking on this <A href="" onclick="docFragAppendTest(); return false;">link</A> will add two words to the end of this paragraph.</P> |
michael@0 | 33 | |
michael@0 | 34 | <P ID="replaceTest"> |
michael@0 | 35 | Clicking on this <A href="" onclick="docFragReplaceTest(); return false;">link</A> will replace the following two words with new ones: <span id="replaceSpan">two words</span>. |
michael@0 | 36 | </P> |
michael@0 | 37 | |
michael@0 | 38 | </BODY> |
michael@0 | 39 | </HTML> |