layout/style/test/test_bug716226.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/test/test_bug716226.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=716226
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 716226</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <style id="s">
    1.15 +    @keyframes foo { }
    1.16 +  </style>
    1.17 +</head>
    1.18 +<body>
    1.19 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716226">Mozilla Bug 716226</a>
    1.20 +<p id="display"></p>
    1.21 +<div id="content" style="display: none">
    1.22 +  
    1.23 +</div>
    1.24 +<pre id="test">
    1.25 +<script type="application/javascript">
    1.26 +
    1.27 +/** Test for Bug 716226 **/
    1.28 +var sheet = $("s").sheet;
    1.29 +var rules = sheet.cssRules;
    1.30 +is(rules.length, 1, "Should have one keyframes rule");
    1.31 +var keyframesRule = rules[0];
    1.32 +var keyframeRules = keyframesRule.cssRules;
    1.33 +is(keyframeRules.length, 0, "Should have no keyframe rules yet");
    1.34 +
    1.35 +keyframesRule.appendRule('0% { }');
    1.36 +is(keyframeRules.length, 1, "Should have a keyframe rule now");
    1.37 +var keyframeRule = keyframeRules[0];
    1.38 +is(keyframeRule.parentRule, keyframesRule,
    1.39 +   "Parent of keyframe should be keyframes");
    1.40 +is(keyframeRule.parentStyleSheet, sheet,
    1.41 +   "Parent stylesheet of keyframe should be our sheet");
    1.42 +
    1.43 +is(keyframeRule.style.cssText, "", "Should have no declarations yet");
    1.44 +// Note: purposefully non-canonical cssText string so we can make sure we
    1.45 +// really invoked the CSS parser and serializer.
    1.46 +keyframeRule.style.cssText = "color:green";
    1.47 +is(keyframeRule.style.cssText, "color: green;",
    1.48 +   "Should have the declarations we set now");
    1.49 +
    1.50 +
    1.51 +
    1.52 +</script>
    1.53 +</pre>
    1.54 +</body>
    1.55 +</html>

mercurial