layout/reftests/table-dom/insertCaptionsAndRows4.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 class="reftest-wait">
michael@0 2 <head>
michael@0 3
michael@0 4 <style>
michael@0 5 caption { color: green }
michael@0 6 </style>
michael@0 7
michael@0 8 <script>
michael@0 9 function boom()
michael@0 10 {
michael@0 11 document.body.offsetHeight;
michael@0 12
michael@0 13 var table = document.getElementById("table");
michael@0 14 var tbody = document.getElementById("tbody");
michael@0 15
michael@0 16 var newtbody = document.createElement("tbody");
michael@0 17 var newrow = document.createElement("tr");
michael@0 18 var newcell = document.createElement("td");
michael@0 19 newcell.appendChild(document.createTextNode("a new row 1"));
michael@0 20 newrow.appendChild(newcell);
michael@0 21 newtbody.appendChild(newrow);
michael@0 22 table.insertBefore(newtbody, tbody);
michael@0 23
michael@0 24 var caption = document.createElement("caption");
michael@0 25 caption.appendChild(document.createTextNode("this is a caption that you shouldn't see"));
michael@0 26 table.insertBefore(caption, tbody);
michael@0 27
michael@0 28 newtbody = document.createElement("tbody");
michael@0 29 newrow = document.createElement("tr");
michael@0 30 newcell = document.createElement("td");
michael@0 31 newcell.appendChild(document.createTextNode("a new row 2"));
michael@0 32 newrow.appendChild(newcell);
michael@0 33 newtbody.appendChild(newrow);
michael@0 34 table.insertBefore(newtbody, tbody);
michael@0 35
michael@0 36 document.body.offsetHeight;
michael@0 37 document.documentElement.className = "";
michael@0 38 }
michael@0 39 </script>
michael@0 40
michael@0 41 </head>
michael@0 42 <body onload="boom();">
michael@0 43 <table id="table">
michael@0 44 <caption>this is the caption</caption>
michael@0 45 <tbody id="tbody"><tr><td>a row</td></tr></tbody>
michael@0 46 </table>
michael@0 47 </body>
michael@0 48 </html>

mercurial