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

Side by Side Diff: LayoutTests/fast/css/parsing-color-quirk.html

Issue 1122293002: Disallow hashless hex color quirk for non integer <number> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 5 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
« no previous file with comments | « no previous file | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
29 #t21 { stroke: ff0000 } 29 #t21 { stroke: ff0000 }
30 #t22 { stop-color: ff0000 } 30 #t22 { stop-color: ff0000 }
31 #t23 { flood-color: ff0000 } 31 #t23 { flood-color: ff0000 }
32 #t24 { lighting-color: ff0000 } 32 #t24 { lighting-color: ff0000 }
33 33
34 #t25 { border-top: ff0000 } 34 #t25 { border-top: ff0000 }
35 #t26 { border-left: ff0000 } 35 #t26 { border-left: ff0000 }
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
40 #t30 { background-color: 1.1 }
41 #t31 { background-color: +1.1 }
42 #t32 { background-color: 1e1 }
43 #t33 { background-color: 1e+1 }
44 #t34 { background-color: 1e-1 }
39 </style> 45 </style>
40 <script> 46 <script>
41 var sheet = document.styleSheets[0]; 47 var sheet = document.styleSheets[0];
42 48
43 test(function(){ assert_true(!!sheet); }, "StyleSheet present"); 49 test(function(){ assert_true(!!sheet); }, "StyleSheet present");
44 test(function(){ assert_equals(sheet.cssRules.length, 29); }, "All rules parsed" ); 50 test(function(){ assert_equals(sheet.cssRules.length, 34); }, "All rules parsed" );
45 51
46 test(function(){ 52 test(function(){
47 assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)"); 53 assert_equals(sheet.cssRules[0].style.color, "rgb(0, 128, 0)");
48 }, "Hashless color quirk for color property"); 54 }, "Hashless color quirk for color property");
49 55
50 test(function(){ 56 test(function(){
51 assert_equals(sheet.cssRules[1].style.backgroundColor, "rgb(0, 128, 0)"); 57 assert_equals(sheet.cssRules[1].style.backgroundColor, "rgb(0, 128, 0)");
52 }, "Hashless color quirk for background-color property"); 58 }, "Hashless color quirk for background-color property");
53 59
54 test(function(){ 60 test(function(){
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 assert_equals(sheet.cssRules[26].style.borderRightColor, ""); 157 assert_equals(sheet.cssRules[26].style.borderRightColor, "");
152 }, "No hashless color quirk for border-right shorthand"); 158 }, "No hashless color quirk for border-right shorthand");
153 159
154 test(function(){ 160 test(function(){
155 assert_equals(sheet.cssRules[27].style.borderBottomColor, ""); 161 assert_equals(sheet.cssRules[27].style.borderBottomColor, "");
156 }, "No hashless color quirk for border-bottom shorthand"); 162 }, "No hashless color quirk for border-bottom shorthand");
157 163
158 test(function(){ 164 test(function(){
159 assert_equals(sheet.cssRules[28].style.borderTopColor, ""); 165 assert_equals(sheet.cssRules[28].style.borderTopColor, "");
160 }, "No hashless color quirk for border shorthand"); 166 }, "No hashless color quirk for border shorthand");
167
168 test(function(){
169 assert_equals(sheet.cssRules[29].style.backgroundColor, "");
170 }, "No hashless color quirk for background-color property with invalid hashless value");
171
172 test(function(){
173 assert_equals(sheet.cssRules[30].style.backgroundColor, "");
174 }, "No hashless color quirk for background-color property with invalid hashless value");
175
176 test(function(){
177 assert_equals(sheet.cssRules[31].style.backgroundColor, "");
178 }, "No hashless color quirk for background-color property with invalid hashless value");
179
180 test(function(){
181 assert_equals(sheet.cssRules[32].style.backgroundColor, "");
182 }, "No hashless color quirk for background-color property with invalid hashless value");
183
184 test(function(){
185 assert_equals(sheet.cssRules[33].style.backgroundColor, "");
186 }, "No hashless color quirk for background-color property with invalid hashless value");
187
161 </script> 188 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698