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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html

Issue 1963843002: Implement stricter hashless hex color parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 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 | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html b/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
index e3ce4577b2594bab45e1f6c0aa3abc7e0c89302b..a77f94380632e106b571ac005c4b16dafb1145b8 100644
--- a/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
+++ b/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
@@ -48,6 +48,11 @@
#t37 { border-color: 00101010 }
#t38 { border-color: ff10 }
#t39 { border-color: ff101010 }
+#t40 { background-color: 0.000ff }
+#t41 { background-color: -0001ff }
+#t42 { background-color: -0.000ff }
+#t43 { background-color: -1.1 }
+#t44 { background-color: -1 }
</style>
<div></div>
<script>
@@ -61,7 +66,7 @@ function testElementWithColorStyle(colorString) {
var sheet = document.styleSheets[0];
test(function(){ assert_true(!!sheet); }, "StyleSheet present");
-test(function(){ assert_equals(sheet.cssRules.length, 39); }, "All rules parsed");
+test(function(){ assert_equals(sheet.cssRules.length, 44); }, "All rules parsed");
test(function(){
assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)");
@@ -238,4 +243,25 @@ test(function(){
var element = testElementWithColorStyle("FF00FF00");
assert_equals(element.style.color, "");
}, "8 digit hex: FF00FF00 must be ignored in quirks-mode");
+
+test(function(){
+ assert_equals(sheet.cssRules[39].style.backgroundColor, "");
+}, "No hashless color quirk for background-color property with invalid hashless value");
+
+test(function(){
+ assert_equals(sheet.cssRules[40].style.backgroundColor, "");
+}, "No hashless color quirk for background-color property with invalid hashless value");
+
+test(function(){
+ assert_equals(sheet.cssRules[41].style.backgroundColor, "");
+}, "No hashless color quirk for background-color property with invalid hashless value");
+
+test(function(){
+ assert_equals(sheet.cssRules[42].style.backgroundColor, "");
+}, "No hashless color quirk for background-color property with invalid hashless value");
+
+test(function(){
+ assert_equals(sheet.cssRules[43].style.backgroundColor, "");
+}, "No hashless color quirk for background-color property with invalid hashless value");
+
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698