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

Side by Side 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: Add more subtests 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 #t36 { background-color: 0.000ff }
47 #t37 { background-color: -0001ff }
48 #t38 { background-color: -0.000ff }
49 #t39 { background-color: -1.1 }
50 #t40 { background-color: -1 }
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, 40); }, "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.backgroundColor, "");
200 }, "No hashless color quirk for background-color property with invalid hashless value");
201
202 test(function(){
203 assert_equals(sheet.cssRules[36].style.backgroundColor, "");
204 }, "No hashless color quirk for background-color property with invalid hashless value");
205
206 test(function(){
207 assert_equals(sheet.cssRules[37].style.backgroundColor, "");
208 }, "No hashless color quirk for background-color property with invalid hashless value");
209
210 test(function(){
211 assert_equals(sheet.cssRules[38].style.backgroundColor, "");
212 }, "No hashless color quirk for background-color property with invalid hashless value");
213
214 test(function(){
215 assert_equals(sheet.cssRules[39].style.backgroundColor, "");
216 }, "No hashless color quirk for background-color property with invalid hashless value");
193 </script> 217 </script>
rune 2016/05/10 21:27:32 What's the pass rate of http://w3c-test.org/quirks
rwlbuis 2016/05/10 21:34:31 Without patch 26 fail, with patch 0 fail :) Thanks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698