layout/style/test/test_at_rule_parse_serialize.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 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=478160
     5 -->
     6 <head>
     7   <title>Test for Bug 478160</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10   <style id="style" type="text/css"></style>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478160">Mozilla Bug 478160</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    17 </div>
    18 <pre id="test">
    19 <script type="application/javascript">
    21 /** Test for Bug 478160 **/
    23 var style_element = document.getElementById("style");
    24 var style_text = document.createTextNode("");
    25 style_element.appendChild(style_text);
    27 function test_at_rule(str) {
    28     style_text.data = str;
    29     is(style_element.sheet.cssRules.length, 1,
    30        "should have one rule from " + str);
    31     var ser1 = style_element.sheet.cssRules[0].cssText;
    32     isnot(ser1, "", "should have non-empty rule from " + str);
    33     style_text.data = ser1;
    34     var ser2 = style_element.sheet.cssRules[0].cssText;
    35     is(ser2, ser1, "parse+serialize should be idempotent for " + str);
    36 }
    38 test_at_rule("@namespace 'a b'");
    40 </script>
    41 </pre>
    42 </body>
    43 </html>

mercurial