Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / parsing-expr-error-recovery.html
blobe7138eb9fb3446d1279bf100100393d9bff9c373
1 <html>
2 <body>
3 <div>Tests that CSS parser correctly recovers after {}, () and [] invalid blocks.</div>
4 <div id="result"></div>
5 <div id="tests"></div>
6 <script type="text/javascript">
7 if (window.testRunner)
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);
24 var failed = 0;
25 for (var test = tests.firstChild; test; test = test.nextSibling) {
26 if (getComputedStyle(test).display != "none")
27 failed++;
30 document.getElementById("result").textContent = failed ? "Failed " + failed + " tests" : "All tests passed";
32 </script>
33 </body>