layout/style/test/test_bug657143.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=657143
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 657143</title>
michael@0 8 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
michael@0 9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 11 </head>
michael@0 12 <body>
michael@0 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=657143">Mozilla Bug 657143</a>
michael@0 14 <p id="display"></p>
michael@0 15 <div id="content" style="display: none">
michael@0 16
michael@0 17 </div>
michael@0 18 <pre id="test">
michael@0 19 <script class="testbody" type="text/javascript">
michael@0 20
michael@0 21 /** Test for Bug 657143 **/
michael@0 22
michael@0 23 // Checks ordering of CSS properties in nsComputedDOMStyle.cpp
michael@0 24 // by splitting the getComputedStyle() into the three sublists
michael@0 25 // then cloning and sort()ing the lists and comparing with originals
michael@0 26
michael@0 27 var styleList = window.getComputedStyle(document.documentElement);
michael@0 28 cssA = [], mozA = [], svgA = [], mozList = false,
michael@0 29 svgList = false, noMozInSVG = true;
michael@0 30 // Need to split into sublists to compare
michael@0 31 for (var i = 0, j = styleList.length; i < j; i++) {
michael@0 32 var prop = styleList.item(i);
michael@0 33 // Check for start of -moz- list
michael@0 34 if (!mozList && /^-moz-/.test(prop)) {
michael@0 35 // Make sure no -moz- in the SVG list
michael@0 36 if (!svgList) {
michael@0 37 mozList = true;
michael@0 38 } else {
michael@0 39 noMozInSVG = false;
michael@0 40 // Don't add to svgA so can still test SVG order
michael@0 41 continue;
michael@0 42 }
michael@0 43 }
michael@0 44 // Add properties to the three lists
michael@0 45 if (mozList) {
michael@0 46 // Check for start of SVG list
michael@0 47 // Will break if any SVG props added before, unlikely though?
michael@0 48 if (prop == 'clip-path') {
michael@0 49 svgList = true;
michael@0 50 mozList = false;
michael@0 51 svgA.push(prop);
michael@0 52 } else {
michael@0 53 mozA.push(prop);
michael@0 54 }
michael@0 55 } else if (svgList) {
michael@0 56 svgA.push(prop);
michael@0 57 } else {
michael@0 58 cssA.push(prop);
michael@0 59 }
michael@0 60 }
michael@0 61 var cssB = cssA.slice(0),
michael@0 62 mozB = mozA.slice(0),
michael@0 63 svgB = svgA.slice(0);
michael@0 64 cssB.sort();
michael@0 65 mozB.sort();
michael@0 66 svgB.sort();
michael@0 67 is(cssA.toString(), cssB.toString(), 'CSS property list should be alphabetical');
michael@0 68 is(mozA.toString(), mozB.toString(), 'Experimental -moz- CSS property list should be alphabetical and not contain mature properties');
michael@0 69 is(svgA.toString(), svgB.toString(), 'SVG property list should be alphabetical');
michael@0 70 ok(noMozInSVG, 'Experimental -moz- CSS properties should not be in the SVG property list');
michael@0 71
michael@0 72 </script>
michael@0 73 </pre>
michael@0 74 </body>
michael@0 75 </html>

mercurial