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.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=861217
5 -->
6 <head>
7 <title>Test for Bug 861217</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
10 </head>
11 <body onload="runTest()">
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861217">Mozilla Bug 861217</a>
13 <p id="display"></p>
14 <div id="content">
15 <table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 50px">
16 <tbody>
17 <tr>
18 <td id="tableCell1" style="overflow: hidden"><div style="width: 100px; height: 100px; background-color: DodgerBlue">1</div></td>
19 </tr>
20 <tr>
21 <td id="tableCell2" style="overflow: hidden"><div style="margin-top: 5px; margin-left: 7px; width: 100px; height: 100px; background-color: SkyBlue">2</div></td>
22 </tr>
23 <tr>
24 <td id="tableCell3" style="overflow: hidden"><div style="display: inline-block; margin-right: 8px; margin-bottom: 10px; width: 100px; height: 100px; background-color: Khaki">3</div></td>
25 </tr>
26 <tr>
27 <td id="tableCell4" style="overflow: hidden"><div style="display: inline-block; margin-right: 3px; margin-left: 1px; box-sizing: border-box; width: 100px; height: 100px; border-left: 6px solid black; border-bottom: 2px solid black; background-color: LightCoral">4</div></td>
28 </tr>
29 <tr>
30 <td id="tableCell5" style="overflow: hidden"><div style="display: inline-block; border-right: 9px solid black; width: 100px; height: 100px; background-color: LightSeaGreen">5</div></td>
31 </tr>
32 <tr>
33 <td id="tableCell6" style="overflow: hidden"><div style="box-sizing: border-box; width: 100px; height: 100px; padding-top: 3px; padding-right: 13px; background-color: Orange">6</div></td>
34 </tr>
35 <tr>
36 <td id="tableCell7" style="overflow: hidden"><div style="display: inline-block; margin-right: 11px; margin-left: 4px; box-sizing: border-box; width: 100px; height: 100px; border-right: 6px solid black; border-bottom: 8px solid black; padding-top: 5px; padding-right: 9px; padding-bottom: 8px; padding-left: 7px; background-color: Silver">7</div></td>
37 </tr>
38 <tr>
39 <td id="tableCell8" style="overflow: hidden"><div style="display: inline-block; margin-top: 7px; margin-bottom: 1px; border-right: 6px solid black; border-bottom: 8px solid black; padding-top: 5px; padding-right: 9px; padding-bottom: 8px; padding-left: 7px; width: 100px; height: 100px; background-color: Turquoise">8</div></td>
40 </tr>
41 </tbody>
42 </table>
43 <div id="status" style="display: none"></div>
44 </div>
45 <pre id="test">
46 <script class="testbody" type="text/javascript">
48 SimpleTest.waitForExplicitFinish();
50 /** Test for Bug 861217 **/
51 function runTest() {
52 var tableCell1 = document.getElementById("tableCell1"),
53 bcr1 = tableCell1.getBoundingClientRect(),
54 tableCell2 = document.getElementById("tableCell2"),
55 bcr2 = tableCell2.getBoundingClientRect(),
56 tableCell3 = document.getElementById("tableCell3"),
57 bcr3 = tableCell3.getBoundingClientRect(),
58 tableCell4 = document.getElementById("tableCell4"),
59 bcr4 = tableCell4.getBoundingClientRect(),
60 tableCell5 = document.getElementById("tableCell5"),
61 bcr5 = tableCell5.getBoundingClientRect(),
62 tableCell6 = document.getElementById("tableCell6"),
63 bcr6 = tableCell6.getBoundingClientRect(),
64 tableCell7 = document.getElementById("tableCell7"),
65 bcr7 = tableCell7.getBoundingClientRect(),
66 tableCell8 = document.getElementById("tableCell8"),
67 bcr8 = tableCell8.getBoundingClientRect();
69 is(bcr1.width, 50, "Width of bounding client rect of #tableCell1");
70 is(tableCell1.scrollWidth, 100, "scrollWidth of #tableCell1");
71 is(bcr1.height, 100, "Height of bounding client rect of #tableCell1");
72 is(tableCell1.scrollHeight, 100, "scrollHeight of #tableCell1");
74 is(bcr2.width, 50, "Width of bounding client rect of #tableCell2");
75 is(tableCell2.scrollWidth, 107, "scrollWidth of #tableCell2");
76 is(bcr2.height, 105, "Height of bounding client rect of #tableCell2");
77 is(tableCell2.scrollHeight, 105, "scrollHeight of #tableCell2");
79 is(bcr3.width, 50, "Width of bounding client rect of #tableCell3");
80 is(tableCell3.scrollWidth, 108, "scrollWidth of #tableCell3");
81 is(bcr3.height, 110, "Height of bounding client rect of #tableCell3");
82 is(tableCell3.scrollHeight, 110, "scrollHeight of #tableCell3");
84 is(bcr4.width, 50, "Width of bounding client rect of #tableCell4");
85 is(tableCell4.scrollWidth, 104, "scrollWidth of #tableCell4");
86 is(bcr4.height, 100, "Height of bounding client rect of #tableCell4");
87 is(tableCell4.scrollHeight, 100, "scrollHeight of #tableCell4");
89 is(bcr5.width, 50, "Width of bounding client rect of #tableCell5");
90 is(tableCell5.scrollWidth, 109, "scrollWidth of #tableCell5");
91 is(bcr5.height, 100, "Height of bounding client rect of #tableCell5");
92 is(tableCell5.scrollHeight, 100, "scrollHeight of #tableCell5");
94 is(bcr6.width, 50, "Width of bounding client rect of #tableCell6");
95 is(tableCell6.scrollWidth, 100, "scrollWidth of #tableCell6");
96 is(bcr6.height, 100, "Height of bounding client rect of #tableCell6");
97 is(tableCell6.scrollHeight, 100, "scrollHeight of #tableCell6");
99 is(bcr7.width, 50, "Width of bounding client rect of #tableCell7");
100 is(tableCell7.scrollWidth, 115, "scrollWidth of #tableCell7");
101 is(bcr7.height, 100, "Height of bounding client rect of #tableCell7");
102 is(tableCell7.scrollHeight, 100, "scrollHeight of #tableCell7");
104 is(bcr8.width, 50, "Width of bounding client rect of #tableCell8");
105 is(tableCell8.scrollWidth, 122, "scrollWidth of #tableCell8");
106 is(bcr8.height, 129, "Height of bounding client rect of #tableCell8");
107 is(tableCell8.scrollHeight, 129, "scrollHeight of #tableCell8");
109 SimpleTest.finish();
110 }
112 </script>
113 </pre>
114 </body>
115 </html>