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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/parsing-expr-error-recovery-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/parsing-expr-error-recovery.html
diff --git a/LayoutTests/fast/css/parsing-expr-error-recovery.html b/LayoutTests/fast/css/parsing-expr-error-recovery.html
new file mode 100644
index 0000000000000000000000000000000000000000..e7138eb9fb3446d1279bf100100393d9bff9c373
--- /dev/null
+++ b/LayoutTests/fast/css/parsing-expr-error-recovery.html
@@ -0,0 +1,33 @@
+<html>
+<body>
+<div>Tests that CSS parser correctly recovers after {}, () and [] invalid blocks.</div>
+<div id="result"></div>
+<div id="tests"></div>
+<script type="text/javascript">
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var BASE_EXPR = "1px,\"x\",var(y) /calc(1px + (((5px)))),-webkit-min(1px,2px)";
+var INVALID_BLOCKS = ["#", "{}", "()", "[]", "{(){{}{{}}[]}}", "(})", "(])", "[}]", "[)]", "{)}", "{]}", "#({})"];
+
+var tests = document.getElementById("tests");
+for (var i = 0; i <= BASE_EXPR.length; i++) {
+ for (var j = 0; j < INVALID_BLOCKS.length; j++) {
+ var invalidExpr = BASE_EXPR.substr(0, i) + INVALID_BLOCKS[j] + BASE_EXPR.substr(i);
+ var test = document.createElement("DIV");
+ test.textContent = "failed: " + invalidExpr;
+ test.style.cssText = "color:" + invalidExpr + "; display: none;";
+ tests.appendChild(test);
+ }
+}
+
+var failed = 0;
+for (var test = tests.firstChild; test; test = test.nextSibling) {
+ if (getComputedStyle(test).display != "none")
+ failed++;
+}
+
+document.getElementById("result").textContent = failed ? "Failed " + failed + " tests" : "All tests passed";
+
+</script>
+</body>
« 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