Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Side by Side Diff: LayoutTests/fast/css/parsing-expr-error-recovery.html

Issue 14897004: Skipping {}, () and [] blocks while error recovering in CSS. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/css/parsing-expr-error-recovery-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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();
9
10 var BASE_EXPR = "1px,\"x\",var(y) /calc(1px + (((5px)))),-webkit-min(1px,2px)";
11 var INVALID_BLOCKS = ["#", "{}", "()", "[]", "{(){{}{{}}[]}}", "(})", "(])", "[} ]", "[)]", "{)}", "{]}", "#({})"];
12
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);
21 }
22 }
23
24 var failed = 0;
25 for (var test = tests.firstChild; test; test = test.nextSibling) {
26 if (getComputedStyle(test).display != "none")
27 failed++;
28 }
29
30 document.getElementById("result").textContent = failed ? "Failed " + failed + " tests" : "All tests passed";
31
32 </script>
33 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/parsing-expr-error-recovery-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698