layout/style/test/test_bug511909.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.)

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

mercurial