Thu, 15 Jan 2015 21:03:48 +0100
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 | <html><!-- |
michael@0 | 2 | https://bugzilla.mozilla.org/show_bug.cgi?id=511909 |
michael@0 | 3 | --><head> |
michael@0 | 4 | <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
michael@0 | 5 | <title>@media and @-moz-document testcases</title> |
michael@0 | 6 | |
michael@0 | 7 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 8 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> |
michael@0 | 9 | |
michael@0 | 10 | <style type="text/css"> |
michael@0 | 11 | a { |
michael@0 | 12 | font-weight: bold; |
michael@0 | 13 | } |
michael@0 | 14 | #pink { |
michael@0 | 15 | color: pink; |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | #green { |
michael@0 | 19 | color: green; |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | #blue { |
michael@0 | 23 | color: blue; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | |
michael@0 | 27 | pre { |
michael@0 | 28 | border: 1px solid black; |
michael@0 | 29 | } |
michael@0 | 30 | </style> |
michael@0 | 31 | |
michael@0 | 32 | <style type="text/css"> |
michael@0 | 33 | @-moz-document regexp(".*test_bug511909.*"){ |
michael@0 | 34 | #d { |
michael@0 | 35 | color: pink; |
michael@0 | 36 | } |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | </style> |
michael@0 | 40 | |
michael@0 | 41 | <style type="text/css"> |
michael@0 | 42 | |
michael@0 | 43 | @media screen { |
michael@0 | 44 | #m { |
michael@0 | 45 | color: green; |
michael@0 | 46 | } |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | </style> |
michael@0 | 50 | |
michael@0 | 51 | <style type="text/css"> |
michael@0 | 52 | |
michael@0 | 53 | @-moz-document regexp(".*test_bug511909.*"){ |
michael@0 | 54 | @media screen { |
michael@0 | 55 | #dm { |
michael@0 | 56 | color: blue; |
michael@0 | 57 | } |
michael@0 | 58 | } |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | </style> |
michael@0 | 62 | |
michael@0 | 63 | <!-- should parse --> |
michael@0 | 64 | <style type="text/css"> |
michael@0 | 65 | |
michael@0 | 66 | @media print { |
michael@0 | 67 | @-moz-document regexp("not_this_url"),} |
michael@0 | 68 | #mx { |
michael@0 | 69 | color: pink; |
michael@0 | 70 | } |
michael@0 | 71 | } |
michael@0 | 72 | } |
michael@0 | 73 | |
michael@0 | 74 | </style> |
michael@0 | 75 | |
michael@0 | 76 | <!-- should parse --> |
michael@0 | 77 | <style type="text/css"> |
michael@0 | 78 | |
michael@0 | 79 | @-moz-document regexp("not_this_url"){ |
michael@0 | 80 | @media print ,} |
michael@0 | 81 | #mxx { |
michael@0 | 82 | color: blue; |
michael@0 | 83 | } |
michael@0 | 84 | } |
michael@0 | 85 | } |
michael@0 | 86 | |
michael@0 | 87 | </style> |
michael@0 | 88 | |
michael@0 | 89 | <style type="text/css"> |
michael@0 | 90 | |
michael@0 | 91 | @media screen { |
michael@0 | 92 | @-moz-document regexp(".*test_bug511909.*"){ |
michael@0 | 93 | #md { |
michael@0 | 94 | color: green; |
michael@0 | 95 | } |
michael@0 | 96 | } |
michael@0 | 97 | } |
michael@0 | 98 | |
michael@0 | 99 | </style> |
michael@0 | 100 | |
michael@0 | 101 | <style type="text/css"> |
michael@0 | 102 | |
michael@0 | 103 | @media screen { |
michael@0 | 104 | @-moz-document regexp(".*test_bug511909.*"){ |
michael@0 | 105 | @media screen { |
michael@0 | 106 | @-moz-document regexp(".*test_bug511909.*"){ |
michael@0 | 107 | @media screen { |
michael@0 | 108 | #me { |
michael@0 | 109 | color: blue; |
michael@0 | 110 | } |
michael@0 | 111 | } |
michael@0 | 112 | } |
michael@0 | 113 | } |
michael@0 | 114 | } |
michael@0 | 115 | } |
michael@0 | 116 | |
michael@0 | 117 | </style> |
michael@0 | 118 | </head> |
michael@0 | 119 | <body> |
michael@0 | 120 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=511909">Mozilla Bug 511909</a> |
michael@0 | 121 | <p id="display"></p> |
michael@0 | 122 | <div id="content" style="display: none"> |
michael@0 | 123 | |
michael@0 | 124 | </div> |
michael@0 | 125 | |
michael@0 | 126 | <script class="testbody" type="text/javascript"> |
michael@0 | 127 | |
michael@0 | 128 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 129 | |
michael@0 | 130 | addLoadEvent(function() { |
michael@0 | 131 | var pink = getComputedStyle(document.getElementById("pink"), ""); |
michael@0 | 132 | var green = getComputedStyle(document.getElementById("green"), ""); |
michael@0 | 133 | var blue = getComputedStyle(document.getElementById("blue"), ""); |
michael@0 | 134 | |
michael@0 | 135 | var cs1 = getComputedStyle(document.getElementById("d"), ""); |
michael@0 | 136 | var cs2 = getComputedStyle(document.getElementById("m"), ""); |
michael@0 | 137 | var cs3 = getComputedStyle(document.getElementById("dm"), ""); |
michael@0 | 138 | var cs4 = getComputedStyle(document.getElementById("md"), ""); |
michael@0 | 139 | var cs5 = getComputedStyle(document.getElementById("mx"), ""); |
michael@0 | 140 | var cs6 = getComputedStyle(document.getElementById("mxx"), ""); |
michael@0 | 141 | var cs7 = getComputedStyle(document.getElementById("me"), ""); |
michael@0 | 142 | |
michael@0 | 143 | is(cs1.color, pink.color, "@-moz-document applies"); |
michael@0 | 144 | is(cs2.color, green.color, "@media applies"); |
michael@0 | 145 | is(cs3.color, blue.color, "@media nested in @-moz-document applies"); |
michael@0 | 146 | is(cs4.color, green.color, "@-moz-document nested in @media applies"); |
michael@0 | 147 | is(cs5.color, pink.color, "broken @media nested in @-moz-document correctly handled"); |
michael@0 | 148 | is(cs6.color, blue.color, "broken @-moz-document nested in @media correctly handled"); |
michael@0 | 149 | is(cs7.color, blue.color, "@media nested in @-moz-document nested in @media applies"); |
michael@0 | 150 | SimpleTest.finish(); |
michael@0 | 151 | }); |
michael@0 | 152 | </script> |
michael@0 | 153 | <div> |
michael@0 | 154 | <pre>default style |
michael@0 | 155 | </pre> |
michael@0 | 156 | <a id="pink">This line should be pink</a><br> |
michael@0 | 157 | |
michael@0 | 158 | <a id="green">This line should be green</a><br> |
michael@0 | 159 | |
michael@0 | 160 | <a id="blue">This line should be blue</a><br> |
michael@0 | 161 | |
michael@0 | 162 | <pre>@-moz-document {...} |
michael@0 | 163 | </pre> |
michael@0 | 164 | <a id="d">This line should be pink</a><br> |
michael@0 | 165 | <pre>@media screen {...} |
michael@0 | 166 | </pre> |
michael@0 | 167 | <a id="m">This line should be green</a><br> |
michael@0 | 168 | <pre>@-moz-document { |
michael@0 | 169 | @media screen {...} |
michael@0 | 170 | } |
michael@0 | 171 | </pre> |
michael@0 | 172 | <a id="dm">This line should be blue</a><br> |
michael@0 | 173 | <pre>@media print { |
michael@0 | 174 | @-moz-document regexp("not_this_url"),} |
michael@0 | 175 | #mx { |
michael@0 | 176 | color: pink; |
michael@0 | 177 | } |
michael@0 | 178 | } |
michael@0 | 179 | } |
michael@0 | 180 | </pre> |
michael@0 | 181 | <a id="mx">This line should be pink</a><br></div> |
michael@0 | 182 | <pre>@-moz-document regexp("not_this_url"){ |
michael@0 | 183 | @media print ,} |
michael@0 | 184 | #mxx { |
michael@0 | 185 | color: blue; |
michael@0 | 186 | } |
michael@0 | 187 | } |
michael@0 | 188 | } |
michael@0 | 189 | </pre> |
michael@0 | 190 | <a id="mxx">This line should be blue</a><br> |
michael@0 | 191 | <pre>@media screen { |
michael@0 | 192 | @-moz-documen {...} |
michael@0 | 193 | } |
michael@0 | 194 | </pre> |
michael@0 | 195 | <a id="md">This line should be green</a><br> |
michael@0 | 196 | <pre>@media screen { |
michael@0 | 197 | @-moz-document { |
michael@0 | 198 | @media screen {...} |
michael@0 | 199 | } |
michael@0 | 200 | } |
michael@0 | 201 | </pre> |
michael@0 | 202 | <a id="me">This line should be blue</a><br> |
michael@0 | 203 | |
michael@0 | 204 | |
michael@0 | 205 | </body></html> |