1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Tests CSS parser autocloses braces.
</title>
8 <style type=
"text/css" media=
"screen">
9 @-webkit-keyframes foo {
15 <script type=
"text/javascript" charset=
"utf-8">
16 function findKeyframesRule(rule)
18 var ss = document.styleSheets;
19 for (var i =
0; i < ss.length; ++i) {
20 for (var j =
0; j < ss[i].cssRules.length; ++j) {
21 if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RULE && ss[i].cssRules[j].name == rule)
22 return ss[i].cssRules[j];
31 if (window.testRunner)
32 testRunner.dumpAsText();
34 var keyframes = findKeyframesRule(
"foo");
35 var length = keyframes ? keyframes.cssRules.length : undefined;
36 document.getElementById(
"console").textContent = length ===
4
37 ?
"PASS: keyframes rule has length 4"
38 : (
"FAIL: keyframes rule should have length 4 but had length " + length);
43 <body onload=
"test()">
44 <div>Tests parsing the @-webkit-keyframes rule without closing brace.
"User agents must close all open constructs ... at the end of the style sheet.
"
45 (
<a href=
"http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">http://www.w3.org/TR/CSS21/syndata.html#parsing-errors
</a>). So it must be parsed as if
46 all braces are closed.
</div>
47 <div id=
"console"></div>