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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <script src="../../resources/testharness.js"></script> 1 <script src="../../resources/testharness.js"></script>
2 <script src="../../resources/testharnessreport.js"></script> 2 <script src="../../resources/testharnessreport.js"></script>
3 <style> 3 <style>
4 #t1 { color: 008000 } 4 #t1 { color: 008000 }
5 #t2 { background-color: 008000 } 5 #t2 { background-color: 008000 }
6 #t3 { border-color: 008000 } 6 #t3 { border-color: 008000 }
7 #t4 { border-bottom-color: 008000 } 7 #t4 { border-bottom-color: 008000 }
8 #t5 { border-left-color: 008000 } 8 #t5 { border-left-color: 008000 }
9 #t6 { border-right-color: 008000 } 9 #t6 { border-right-color: 008000 }
10 #t7 { border-top-color: 008000 } 10 #t7 { border-top-color: 008000 }
(...skipping 25 matching lines...) Expand all
36 #t27 { border-right: ff0000 } 36 #t27 { border-right: ff0000 }
37 #t28 { border-bottom: ff0000 } 37 #t28 { border-bottom: ff0000 }
38 #t29 { border: ff0000 } 38 #t29 { border: ff0000 }
39 39
40 #t30 { background-color: 1.1 } 40 #t30 { background-color: 1.1 }
41 #t31 { background-color: +1.1 } 41 #t31 { background-color: +1.1 }
42 #t32 { background-color: 1e1 } 42 #t32 { background-color: 1e1 }
43 #t33 { background-color: 1e+1 } 43 #t33 { background-color: 1e+1 }
44 #t34 { background-color: 1e-1 } 44 #t34 { background-color: 1e-1 }
45 #t35 { background-color: 2222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 2222222222222222222222222f } 45 #t35 { background-color: 2222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222 2222222222222222222222222f }
46
47 #t36 { border-color: 1010 }
48 #t37 { border-color: 00101010 }
49 #t38 { border-color: ff10 }
50 #t39 { border-color: ff101010 }
46 </style> 51 </style>
47 <script> 52 <script>
48 var sheet = document.styleSheets[0]; 53 var sheet = document.styleSheets[0];
49 54
50 test(function(){ assert_true(!!sheet); }, "StyleSheet present"); 55 test(function(){ assert_true(!!sheet); }, "StyleSheet present");
51 test(function(){ assert_equals(sheet.cssRules.length, 35); }, "All rules parsed" ); 56 test(function(){ assert_equals(sheet.cssRules.length, 39); }, "All rules parsed" );
52 57
53 test(function(){ 58 test(function(){
54 assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)"); 59 assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)");
55 }, "Hashless color quirk for color property"); 60 }, "Hashless color quirk for color property");
56 61
57 test(function(){ 62 test(function(){
58 assert_equals(sheet.cssRules[1].style.backgroundColor, "rgb(0, 128, 0)"); 63 assert_equals(sheet.cssRules[1].style.backgroundColor, "rgb(0, 128, 0)");
59 }, "Hashless color quirk for background-color property"); 64 }, "Hashless color quirk for background-color property");
60 65
61 test(function(){ 66 test(function(){
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 }, "No hashless color quirk for background-color property with invalid hashless value"); 188 }, "No hashless color quirk for background-color property with invalid hashless value");
184 189
185 test(function(){ 190 test(function(){
186 assert_equals(sheet.cssRules[33].style.backgroundColor, ""); 191 assert_equals(sheet.cssRules[33].style.backgroundColor, "");
187 }, "No hashless color quirk for background-color property with invalid hashless value"); 192 }, "No hashless color quirk for background-color property with invalid hashless value");
188 193
189 test(function(){ 194 test(function(){
190 assert_equals(sheet.cssRules[34].style.backgroundColor, ""); 195 assert_equals(sheet.cssRules[34].style.backgroundColor, "");
191 }, "No hashless color quirk for background-color property with invalid hashless value"); 196 }, "No hashless color quirk for background-color property with invalid hashless value");
192 197
198 test(function(){
199 assert_equals(sheet.cssRules[35].style.borderColor, "rgb(0, 16, 16)");
200 }, "4 digits: 1010 is a valid <quirky-color>");
201
202 test(function(){
203 assert_equals(sheet.cssRules[36].style.borderColor, "rgb(16, 16, 16)");
204 }, "8 digits: 00101010 is a valid <quirky-color>");
205
206 test(function(){
207 assert_equals(sheet.cssRules[37].style.borderColor, "");
208 }, "No hashless color quirk for border-color property with 4 digit hex value");
209
210 test(function(){
211 assert_equals(sheet.cssRules[38].style.borderColor, "");
212 }, "No hashless color quirk for border-color property with 8 digit hex value");
193 </script> 213 </script>
Timothy Loh 2016/05/12 06:56:08 Test for fast path? e.g. make a div and execute di
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698