layout/style/test/test_bug405818.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=405818
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 405818</title>
michael@0 8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 10 <link rel="stylesheet" type="text/css" href="data:text/css,%23myDiv{color:green;}">
michael@0 11 <link rel="stylesheet" type="text/css" href="chrome://global/skin/global.css">
michael@0 12 <!-- Script to make sure sheets gets a chance to load fully in Gecko 1.8 and earlier -->
michael@0 13 <script type="text/javascript" src="data:text/javascript,"></script>
michael@0 14 <link rel="stylesheet" type="text/css" href="data:text/css,%23myDiv{color:green;}">
michael@0 15 <link rel="stylesheet" type="text/css" href="chrome://global/skin/global.css">
michael@0 16 </head>
michael@0 17 <body>
michael@0 18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=405818">Mozilla Bug 405818</a>
michael@0 19 <p id="display"></p>
michael@0 20 <div id="content" style="display: none">
michael@0 21 <div id="myDiv"></div>
michael@0 22 </div>
michael@0 23 <pre id="test">
michael@0 24 <script class="testbody" type="text/javascript">
michael@0 25
michael@0 26 /** Test for Bug 405818 **/
michael@0 27 SimpleTest.waitForExplicitFinish();
michael@0 28
michael@0 29 addLoadEvent(function() {
michael@0 30 is(document.styleSheets[1].href,
michael@0 31 "data:text/css,%23myDiv{color:green;}",
michael@0 32 "Unexpected href for linked sheet before cloning");
michael@0 33 is(document.styleSheets[3].href,
michael@0 34 "data:text/css,%23myDiv{color:green;}",
michael@0 35 "Unexpected href for later linked sheet before cloning");
michael@0 36
michael@0 37 is(document.styleSheets[2].href,
michael@0 38 "chrome://global/skin/global.css",
michael@0 39 "Unexpected href for linked chrome sheet before cloning");
michael@0 40 is(document.styleSheets[4].href,
michael@0 41 "chrome://global/skin/global.css",
michael@0 42 "Unexpected href for later linked chrome sheet before cloning");
michael@0 43
michael@0 44 // Force cloning of inners
michael@0 45 document.styleSheets[1].cssRules[0];
michael@0 46 SpecialPowers.wrap(document.styleSheets[2]).cssRules[0];
michael@0 47
michael@0 48 is(document.styleSheets[1].href,
michael@0 49 "data:text/css,%23myDiv{color:green;}",
michael@0 50 "Unexpected href for linked sheet after cloning");
michael@0 51 is(document.styleSheets[3].href,
michael@0 52 "data:text/css,%23myDiv{color:green;}",
michael@0 53 "Unexpected href for later linked sheet after cloning");
michael@0 54
michael@0 55 is(document.styleSheets[2].href,
michael@0 56 "chrome://global/skin/global.css",
michael@0 57 "Unexpected href for linked chrome sheet after cloning");
michael@0 58 is(document.styleSheets[4].href,
michael@0 59 "chrome://global/skin/global.css",
michael@0 60 "Unexpected href for later linked chrome sheet after cloning");
michael@0 61
michael@0 62 var myDiv = document.getElementById("myDiv");
michael@0 63 is(getComputedStyle(myDiv, "").color, "rgb(0, 128, 0)",
michael@0 64 "Unexpected color for div (data URI stylesheet not being honored?)");
michael@0 65
michael@0 66 SimpleTest.finish();
michael@0 67 });
michael@0 68 </script>
michael@0 69 </pre>
michael@0 70 </body>
michael@0 71 </html>
michael@0 72

mercurial