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

Unified Diff: LayoutTests/css-parser/at-rule-in-declaration-list.html

Issue 1053953002: CSS Parser: Handle at-rules in declaration lists (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/css-parser/at-rule-in-declaration-list.html
diff --git a/LayoutTests/css-parser/at-rule-in-declaration-list.html b/LayoutTests/css-parser/at-rule-in-declaration-list.html
new file mode 100644
index 0000000000000000000000000000000000000000..1f92c62d0acef9d616387571af1660d14de6276c
--- /dev/null
+++ b/LayoutTests/css-parser/at-rule-in-declaration-list.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<style>
+div {
+ margin: 10px;
+ border: 10px solid green;
+ width: 80px;
+ height: 80px;
+ background: red;
+}
+#a { @some at-rule; background: green; }
+#b { @at-rule yay { } background: green; }
+#c, #d {
+ background: green;
+ border-color: red;
+}
+#c {
+ not-an-at-rule { }
+ background: red;
+ border-color: green;
+}
+#d {
+ #also-not-an-at-rule { }
+ background: red;
+ border-color: green;
+}
+</style>
+
+<div id=a></div>
+<div id=b></div>
+<div id=c></div>
+<div id=d></div>
+<div id=e></div>
+
+<script>
+test(function(){
+ assert_equals(getComputedStyle(a).backgroundColor, "rgb(0, 128, 0)");
+}, "Declarations allowed after semicolon-terminated at-rules in declaration list");
+test(function(){
+ assert_equals(getComputedStyle(b).backgroundColor, "rgb(0, 128, 0)");
+}, "Declarations allowed after at-rules with an associated block in declaration list");
+test(function(){
+ assert_equals(getComputedStyle(c).backgroundColor, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(c).borderColor, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(d).backgroundColor, "rgb(0, 128, 0)");
+ assert_equals(getComputedStyle(d).borderColor, "rgb(0, 128, 0)");
+}, "Error recovery looks for semicolon and not block end");
+</script>
« no previous file with comments | « no previous file | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698