3 <div>Tests that CSS parser correctly recovers after {}, () and [] invalid blocks.
</div>
4 <div id=
"result"></div>
6 <script type=
"text/javascript">
8 testRunner
.dumpAsText();
10 var BASE_EXPR
= "1px,\"x\",var(y) /calc(1px + (((5px)))),-webkit-min(1px,2px)";
11 var INVALID_BLOCKS
= ["#", "{}", "()", "[]", "{(){{}{{}}[]}}", "(})", "(])", "[}]", "[)]", "{)}", "{]}", "#({})"];
13 var tests
= document
.getElementById("tests");
14 for (var i
= 0; i
<= BASE_EXPR
.length
; i
++) {
15 for (var j
= 0; j
< INVALID_BLOCKS
.length
; j
++) {
16 var invalidExpr
= BASE_EXPR
.substr(0, i
) + INVALID_BLOCKS
[j
] + BASE_EXPR
.substr(i
);
17 var test
= document
.createElement("DIV");
18 test
.textContent
= "failed: " + invalidExpr
;
19 test
.style
.cssText
= "color:" + invalidExpr
+ "; display: none;";
20 tests
.appendChild(test
);
25 for (var test
= tests
.firstChild
; test
; test
= test
.nextSibling
) {
26 if (getComputedStyle(test
).display
!= "none")
30 document
.getElementById("result").textContent
= failed
? "Failed " + failed
+ " tests" : "All tests passed";