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

Unified Diff: LayoutTests/fast/css/parsing-unexpected-eof.html

Issue 17129003: Auto-closing at unexpected EOF for all entry points. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Patch Set 2 onto master Created 7 years, 6 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
Index: LayoutTests/fast/css/parsing-unexpected-eof.html
diff --git a/LayoutTests/fast/css/parsing-unexpected-eof.html b/LayoutTests/fast/css/parsing-unexpected-eof.html
new file mode 100644
index 0000000000000000000000000000000000000000..698e3149dc46298ab7b41bc0f16de1a729dd1844
--- /dev/null
+++ b/LayoutTests/fast/css/parsing-unexpected-eof.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS Parser - auto-close for unexpected EOF</title>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ <style>
+ div {}
+ div {}
+ </style>
+ </head>
+ <body>
+ <div id="qs"><i class="x"></i><b></b></div>
+ <script>
+ var sheet = document.styleSheets[0];
+ var rules = sheet.cssRules;
+
+ test(function(){
+ // internal_decls
+ rules[0].style.cssText = "width: 200px; color: rgb(10, 20, 30";
+ assert_equals(rules[0].style.width, "200px", "Width not set correctly.");
+ assert_equals(rules[0].style.color, "rgb(10, 20, 30)", "Color not set correctly");
+ }, "Unexpected EOF - CSSStyleDeclaration.cssText missing ')'");
+
+ test(function(){
+ // internal_value
+ rules[0].style.color = "rgba(0, 0, 0, 0.2";
+ assert_equals(rules[0].style.color, "rgba(0, 0, 0, 0.2)", "rgba value not set correctly");
+ }, "Unexpected EOF - CSSStyleDeclaration.color missing ')'");
+
+ test(function(){
+ // internal_selector
+ rules[0].selectorText = "#x, [name=\"x";
+ assert_equals(rules[0].selectorText, "#x, [name=\"x\"]");
+ }, "Unexpected EOF - CSSStyleRule.selectorText missing ']'");
+
+ test(function(){
+ // internal_rule
+ sheet.insertRule("span { color: green", 2);
+ assert_equals(rules[2].cssText, "span { color: green; }");
+ }, "Unexpected EOF - CSSStyleSheet.insertRule missing '}'");
+
+ test(function(){
+ // internal_selector
+ assert_equals(document.querySelector("#qs [class=x").tagName, "I");
+ }, "Unexpected EOF - querySelector missing ']'");
+
+ test(function(){
+ // internal_selector
+ assert_equals(document.querySelector("#qs :nth-child(2").tagName, "B");
+ }, "Unexpected EOF - querySelector missing ')'");
+ </script>
+ </body>
+</html>
« no previous file with comments | « LayoutTests/cssom/insertrule-syntax-error-01-expected.html ('k') | LayoutTests/fast/css/parsing-unexpected-eof-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698