Changeset 192023 in webkit
- Timestamp:
- Nov 4, 2015 9:49:46 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r192022 r192023 1 2015-11-03 Dean Jackson <dino@apple.com> 2 3 Accept 8 and 4 value hex colors (#RRGGBBAA) 4 https://bugs.webkit.org/show_bug.cgi?id=150853 5 <rdar://problem/23380930> 6 7 Reviewed by Simon Fraser. 8 9 Add a new test for hex colors that covers 4 and 8 value forms. 10 Also update existing tests now that the syntax has changed. 11 12 For the deleted philip tests, they are now in the W3C web-latform-tests import. 13 14 * canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed. 15 * canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html: Removed. 16 * canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed. 17 * canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html: Removed. 18 * fast/css/hex-colors-expected.txt: Added. 19 * fast/css/hex-colors.html: Added. 20 * fast/css/invalid-hex-color-expected.txt: 21 * fast/css/invalid-hex-color.html: 22 * fast/css/invalid-predefined-color-expected.txt: 23 * fast/css/invalid-predefined-color.html: 24 * fast/css/script-tests/invalid-predefined-color.js: 25 * fast/dom/attribute-legacy-colors-expected.txt: 26 * fast/dom/script-tests/attribute-legacy-colors.js: 27 * svg/dom/rgb-color-parser-expected.txt: 28 * svg/dom/rgb-color-parser.html: 29 1 30 2015-11-04 Joanmarie Diggs <jdiggs@igalia.com> 2 31 -
trunk/LayoutTests/fast/css/invalid-hex-color-expected.txt
r67158 r192023 3 3 Test 2 (Invalid: 2 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 4 4 Test 3 (Valid: 3 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 5 Test 4 ( Invalid: 4 hexadecimal digits) [EXPECTED] [ACTUAL] PASS5 Test 4 (Valid: 4 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 6 6 Test 5 (Invalid: 5 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 7 7 Test 6 (Valid: 6 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 8 8 Test 7 (Invalid: 7 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 9 Test 8 (Invalid: 0 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 10 Test 9 (Invalid: 1 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 11 Test 10 (Invalid: 2 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 12 Test 11 (Invalid: 3 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 13 Test 12 (Invalid: 4 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 14 Test 13 (Invalid: 5 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 15 Test 14 (Invalid: 6 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 16 Test 15 (Invalid: 7 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 9 Test 8 (Valid: 8 hexadecimal digits) [EXPECTED] [ACTUAL] PASS 10 Test 9 (Invalid: 0 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 11 Test 10 (Invalid: 1 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 12 Test 11 (Invalid: 2 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 13 Test 12 (Invalid: 3 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 14 Test 13 (Invalid: 4 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 15 Test 14 (Invalid: 5 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 16 Test 15 (Invalid: 6 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 17 Test 16 (Invalid: 7 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS 18 Test 17 (Invalid: 8 hexadecimal digits concatenated with 'px') [EXPECTED] [ACTUAL] PASS -
trunk/LayoutTests/fast/css/invalid-hex-color.html
r120683 r192023 20 20 ["Invalid: 2 hexadecimal digits", "", "border-bottom: solid #11"], 21 21 ["Valid: 3 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111"], 22 [" Invalid: 4 hexadecimal digits", "", "border-bottom: solid #1111"],22 ["Valid: 4 hexadecimal digits", "border-bottom: solid rgba(17,17,17,255)", "border-bottom: solid #111f"], 23 23 ["Invalid: 5 hexadecimal digits", "", "border-bottom: solid #11111"], 24 24 ["Valid: 6 hexadecimal digits", "border-bottom: solid rgb(17,17,17)", "border-bottom: solid #111111"], 25 25 ["Invalid: 7 hexadecimal digits", "", "border-bottom: solid #1111111"], 26 ["Valid: 8 hexadecimal digits", "border-bottom: solid rgba(17,17,17,255)", "border-bottom: solid #111111ff"], 26 27 ["Invalid: 0 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #px"], 27 28 ["Invalid: 1 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1px"], … … 32 33 ["Invalid: 6 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #111111px"], 33 34 ["Invalid: 7 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #1111111px"], 35 ["Invalid: 8 hexadecimal digits concatenated with 'px'", "", "border-bottom: solid #11111111px"], 34 36 ]; 35 37 -
trunk/LayoutTests/fast/css/invalid-predefined-color-expected.txt
r83046 r192023 9 9 PASS getComputedStyle(div, null).color is red 10 10 PASS getComputedStyle(div, null).color is red 11 PASS getComputedStyle(div, null).color is black12 11 PASS getComputedStyle(div, null).color is black 13 12 PASS getComputedStyle(div, null).color is black … … 26 25 This style is "color: #green" 27 26 This style is "color: #FFAALL" 28 This style is "color: #FF000000" -
trunk/LayoutTests/fast/css/invalid-predefined-color.html
r155263 r192023 15 15 <div id="invalid3" style="color: #green">This style is "color: #green"</div> 16 16 <div id="invalid4" style="color: #FFAALL">This style is "color: #FFAALL"</div> 17 <div id="invalid5" style="color: #FF000000">This style is "color: #FF000000"</div>18 17 19 18 <script src="script-tests/invalid-predefined-color.js"></script> -
trunk/LayoutTests/fast/css/script-tests/invalid-predefined-color.js
r98407 r192023 12 12 } 13 13 14 for (var i=1;i<= 5;i++)14 for (var i=1;i<=4;i++) 15 15 { 16 16 var div = document.getElementById("invalid"+i); -
trunk/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt
r91217 r192023 17 17 PASS document.body.bgColor='f00';getComputedStyle(document.body).backgroundColor; is 'rgb(15, 0, 0)' 18 18 PASS document.body.bgColor='ff0000';getComputedStyle(document.body).backgroundColor; is 'rgb(255, 0, 0)' 19 PASS document.body.bgColor='#00000000';getComputedStyle(document.body).backgroundColor; is 'rgb(0, 0, 0)'20 19 PASS document.body.bgColor='foo';getComputedStyle(document.body).backgroundColor; is 'rgb(15, 0, 0)' 21 20 PASS document.body.bgColor='cheese';getComputedStyle(document.body).backgroundColor; is 'rgb(192, 238, 14)' … … 36 35 PASS document.body.bgColor='#55';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 5, 0)' 37 36 PASS document.body.bgColor='#555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)' 38 PASS document.body.bgColor='#5555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 0)'39 37 PASS document.body.bgColor='#55555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 80)' 40 38 PASS document.body.bgColor='#555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)' 41 39 PASS document.body.bgColor='#5555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 80)' 42 PASS document.body.bgColor='#55555555';getComputedStyle(document.body).backgroundColor; is 'rgb(85, 85, 85)'43 40 PASS document.body.bgColor='5';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 0, 0)' 44 41 PASS document.body.bgColor='55';getComputedStyle(document.body).backgroundColor; is 'rgb(5, 5, 0)' -
trunk/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js
r98407 r192023 16 16 {'test':'f00', 'expected':[15, 0, 0]}, 17 17 {'test':'ff0000', 'expected':[255, 0, 0]}, 18 {'test':'#00000000', 'expected':[0, 0, 0]},19 18 {'test':'foo', 'expected':[15, 0, 0]}, 20 19 {'test':'cheese', 'expected':[192, 238, 14]}, … … 35 34 {'test':'#55', 'expected':[5, 5, 0]}, 36 35 {'test':'#555', 'expected':[85, 85, 85]}, 37 {'test':'#5555', 'expected':[85, 85, 0]},38 36 {'test':'#55555', 'expected':[85, 85, 80]}, 39 37 {'test':'#555555', 'expected':[85, 85, 85]}, 40 38 {'test':'#5555555', 'expected':[85, 85, 80]}, 41 {'test':'#55555555', 'expected':[85, 85, 85]},42 39 {'test':'5', 'expected':[5, 0, 0]}, 43 40 {'test':'55', 'expected':[5, 5, 0]}, -
trunk/LayoutTests/imported/w3c/ChangeLog
r191981 r192023 1 2015-11-03 Dean Jackson <dino@apple.com> 2 3 Accept 8 and 4 value hex colors (#RRGGBBAA) 4 https://bugs.webkit.org/show_bug.cgi?id=150853 5 <rdar://problem/23380930> 6 7 Reviewed by Simon Fraser. 8 9 Delete these tests. The have been updated in the original repository, 10 so we'll get the new versions soon. Meanwhile, they are covered by 11 other tests. 12 13 * canvas/2d.fillStyle.parse.invalid.hex4-expected.txt: Removed. 14 * canvas/2d.fillStyle.parse.invalid.hex4.html: Removed. 15 * canvas/2d.fillStyle.parse.invalid.hex8-expected.txt: Removed. 16 * canvas/2d.fillStyle.parse.invalid.hex8.html: Removed. 17 * css/css-color-3/t421-rgb-hex-parsing-f.xht: 18 1 19 2015-11-02 Jon Honeycutt <jhoneycutt@apple.com> 2 20 -
trunk/LayoutTests/imported/w3c/css/css-color-3/t421-rgb-hex-parsing-f.xht
r189353 r192023 13 13 p { color: #f; } 14 14 p { color: #ff; } 15 p { color: #ff00; }16 15 p { color: #ff000; } 17 16 p { color: #ff00000; } 18 p { color: #ff000000; }19 17 p { color: #ff0000000; } 20 18 p { color: #ff00000000; } -
trunk/LayoutTests/svg/dom/rgb-color-parser-expected.txt
r170933 r192023 164 164 Failed to parse: #f 165 165 Failed to parse: #ff 166 Failed to parse: #ffff167 166 Failed to parse: #fffff 168 167 Failed to parse: #fffffff … … 178 177 Parsed as rgb(0,10,20): rgb(0, 10, 20) 179 178 Parsed as rgb(255,255,255): #fff 179 Parsed as rgb(255,255,255): #ffff 180 180 Parsed as rgb(255,255,255): #ffffff 181 Parsed as rgb(255,255,255): #ffffffff 181 182 Parsed as rgb(255,255,255): #FFF 182 183 Parsed as rgb(255,255,255): #FFFFFF -
trunk/LayoutTests/svg/dom/rgb-color-parser.html
r170933 r192023 227 227 parseRGBColor("#f"); 228 228 parseRGBColor("#ff"); 229 parseRGBColor("#ffff");230 229 parseRGBColor("#fffff"); 231 230 parseRGBColor("#fffffff"); … … 243 242 parseRGBColor("rgb(0, 10, 20)"); 244 243 parseRGBColor("#fff"); 244 parseRGBColor("#ffff"); 245 245 parseRGBColor("#ffffff"); 246 parseRGBColor("#ffffffff"); 246 247 parseRGBColor("#FFF"); 247 248 parseRGBColor("#FFFFFF"); -
trunk/Source/WebCore/ChangeLog
r192022 r192023 1 2015-11-03 Dean Jackson <dino@apple.com> 2 3 Accept 8 and 4 value hex colors (#RRGGBBAA) 4 https://bugs.webkit.org/show_bug.cgi?id=150853 5 <rdar://problem/23380930> 6 7 Reviewed by Simon Fraser. 8 9 CSS Color Level 4 allows #RGBA and #RRGGBBAA values 10 for colors. 11 12 Test: fast/css/hex-colors.html 13 14 * platform/graphics/Color.cpp: 15 (WebCore::parseHexColorInternal): Update the color parsing for 16 the new syntax. 17 1 18 2015-11-04 Mario Sanchez Prada <mario@webkit.org> 2 19 -
trunk/Source/WebCore/platform/graphics/Color.cpp
r191243 r192023 129 129 static inline bool parseHexColorInternal(const CharacterType* name, unsigned length, RGBA32& rgb) 130 130 { 131 if (length != 3 && length != 6)131 if (length != 3 && length != 4 && length != 6 && length != 8) 132 132 return false; 133 133 unsigned value = 0; … … 140 140 if (length == 6) { 141 141 rgb = 0xFF000000 | value; 142 return true; 143 } 144 if (length == 8) { 145 // We parsed the values into RGBA order, but the RGBA32 type 146 // expects them to be in ARGB order, so we right rotate eight bits. 147 rgb = value << 24 | value >> 8; 148 return true; 149 } 150 if (length == 4) { 151 // #abcd converts to ddaabbcc in RGBA32. 152 rgb = (value & 0xF) << 28 | (value & 0xF) << 24 153 | (value & 0xF000) << 8 | (value & 0xF000) << 4 154 | (value & 0xF00) << 4 | (value & 0xF00) 155 | (value & 0xF0) | (value & 0xF0) >> 4; 142 156 return true; 143 157 }
Note: See TracChangeset
for help on using the changeset viewer.