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

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

Issue 1936913002: [CSS] Accept 8 (#RRGGBBAA) and 4 (#RGBA) value hex colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Length restrict quirks mode fastParseColorInternal() code. 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
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 70c3cf3aaa88b2f73c805e93990ccdca6e485691..186bb0b33a190cfc46aeea69f66ef710ea0e2fcc 100644
--- a/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
+++ b/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html
@@ -43,12 +43,17 @@
#t33 { background-color: 1e+1 }
#t34 { background-color: 1e-1 }
#t35 { background-color: 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222f }
+
+#t36 { border-color: 1010 }
+#t37 { border-color: 00101010 }
+#t38 { border-color: ff10 }
+#t39 { border-color: ff101010 }
</style>
<script>
var sheet = document.styleSheets[0];
test(function(){ assert_true(!!sheet); }, "StyleSheet present");
-test(function(){ assert_equals(sheet.cssRules.length, 35); }, "All rules parsed");
+test(function(){ assert_equals(sheet.cssRules.length, 39); }, "All rules parsed");
test(function(){
assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)");
@@ -190,4 +195,19 @@ test(function(){
assert_equals(sheet.cssRules[34].style.backgroundColor, "");
}, "No hashless color quirk for background-color property with invalid hashless value");
+test(function(){
+ assert_equals(sheet.cssRules[35].style.borderColor, "rgb(0, 16, 16)");
+}, "4 digits: 1010 is a valid <quirky-color>");
+
+test(function(){
+ assert_equals(sheet.cssRules[36].style.borderColor, "rgb(16, 16, 16)");
+}, "8 digits: 00101010 is a valid <quirky-color>");
+
+test(function(){
+ assert_equals(sheet.cssRules[37].style.borderColor, "");
+}, "No hashless color quirk for border-color property with 4 digit hex value");
+
+test(function(){
+ assert_equals(sheet.cssRules[38].style.borderColor, "");
+}, "No hashless color quirk for border-color property with 8 digit hex value");
</script>
Timothy Loh 2016/05/12 06:56:08 Test for fast path? e.g. make a div and execute di

Powered by Google App Engine
This is Rietveld 408576698