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

Issue 1936913002: [CSS] Accept 8 (#RRGGBBAA) and 4 (#RGBA) value hex colors (Closed)

Created:
4 years, 7 months ago by Noel Gordon
Modified:
4 years, 7 months ago
Reviewers:
Timothy Loh, PhistucK
CC:
blink-reviews, blink-reviews-platform-graphics_chromium.org, blink-reviews-style_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, kinuko+watch, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[CSS] Accept 8 (#RRGGBBAA) and 4 (#RGBA) value hex colors CSS Color Level 4 allows #RRGGBBAA and #RGBA colors. Update Color.cpp parsing for the new syntax. Add a test, ditch the canvas/philip invalid hex tests, update existing tests. Refer to https://bugs.webkit.org/show_bug.cgi?id=150853 and the patch by Dean Jackson to resolve which is included here verbatim, with additional support for legacy HTML attribute color parsing based on Dean's follow-up patch [1]. Obsolete legacy HTML attributes parse colors via the "rules for parsing a legacy colour value" of the HTML micro syntax (see http://bit.ly/1WF2Yre). Limit legacy parsing to accept only 3/6-digit hex color for compat, add a comment (covered by fast/dom/attribute-legacy-colors.html). Fix quirks mode color parse, per http://bit.ly/1VPZFic, and update fast/css/parsing-color-quirk.html with 4/8 digit hex color test cases for the-hashless-hex-color-quirk. Finally, in Blink's fastParseColorInternal() CSS fast path, only allow hashless 3/6-digit hex color in quirks mode, add test cases to fast/css/parsing-color-quirk.html. Spec: https://drafts.csswg.org/css-color/#hex-notation Change in behavior: add fast/css/hex-colors.html [1] http://trac.webkit.org/changeset/200501 BUG=76362 Committed: https://crrev.com/bd42b3e0e1e52b1cbfe630ac7a4c230779111682 Cr-Commit-Position: refs/heads/master@{#393438}

Patch Set 1 : Import Dean's WebKit patch. #

Patch Set 2 : Add legacy color support. #

Patch Set 3 : Legacy color support [1]. #

Patch Set 4 : the-hashless-hex-color-quirk. #

Total comments: 6

Patch Set 5 : Address review comments. #

Patch Set 6 : Length restrict quirks mode fastParseColorInternal() code. #

Total comments: 1

Patch Set 7 : Add quirks mode fastParseColorInternal() test cases. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -79 lines) Patch
D third_party/WebKit/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html View 1 chunk +0 lines, -24 lines 0 comments Download
D third_party/WebKit/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html View 1 chunk +0 lines, -24 lines 0 comments Download
D third_party/WebKit/LayoutTests/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/css-parser/color3-expected.txt View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/css-parser/resources/css-parsing-tests/color3.json View 1 chunk +4 lines, -2 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css/hex-colors.html View 1 2 3 4 1 chunk +78 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css/hex-colors-expected.txt View 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/invalid-hex-color.html View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/invalid-hex-color-expected.txt View 1 chunk +11 lines, -9 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/invalid-predefined-color.html View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/invalid-predefined-color-expected.txt View 2 chunks +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html View 1 2 3 4 5 6 2 chunks +49 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css/script-tests/invalid-predefined-color.js View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser.html View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/svg/dom/rgb-color-parser-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.cpp View 1 2 3 4 5 1 chunk +13 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Color.cpp View 2 chunks +15 lines, -1 line 0 comments Download

Messages

Total messages: 91 (49 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/1
4 years, 7 months ago (2016-05-01 02:00:23 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-01 03:05:45 UTC) #6
PhistucK
This would probably need an intent to ship (or an intent to implement now) when ...
4 years, 7 months ago (2016-05-01 15:43:39 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/20001
4 years, 7 months ago (2016-05-03 11:18:43 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-03 12:23:07 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/40001
4 years, 7 months ago (2016-05-06 07:50:13 UTC) #24
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-06 11:00:43 UTC) #27
Noel Gordon
On 2016/05/01 15:43:39, PhistucK wrote: > This would probably need an intent to ship (or ...
4 years, 7 months ago (2016-05-06 16:20:53 UTC) #30
Noel Gordon
Tim, this is right up your street. Can you review please.
4 years, 7 months ago (2016-05-06 16:22:33 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/60001
4 years, 7 months ago (2016-05-09 07:10:44 UTC) #40
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/224086)
4 years, 7 months ago (2016-05-09 07:48:37 UTC) #42
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/60001
4 years, 7 months ago (2016-05-10 00:06:53 UTC) #44
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-10 01:16:42 UTC) #46
Timothy Loh
lgtm with a couple of small comments https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/hex-colors.html File third_party/WebKit/LayoutTests/fast/css/hex-colors.html (right): https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/hex-colors.html#newcode1 third_party/WebKit/LayoutTests/fast/css/hex-colors.html:1: <script> This ...
4 years, 7 months ago (2016-05-11 07:23:08 UTC) #49
PhistucK
https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html File third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html (right): https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html#newcode200 third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html:200: }, "No hashless color quirk for border-color property with ...
4 years, 7 months ago (2016-05-11 08:02:46 UTC) #51
Timothy Loh
https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html File third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html (right): https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html#newcode200 third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html:200: }, "No hashless color quirk for border-color property with ...
4 years, 7 months ago (2016-05-11 08:05:03 UTC) #52
PhistucK
On 2016/05/11 at 08:05:03, timloh wrote: > https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html > File third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html (right): > > https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html#newcode200 ...
4 years, 7 months ago (2016-05-11 08:12:44 UTC) #53
Timothy Loh
On 2016/05/11 08:12:44, PhistucK wrote: > But is it not an ident-token? If it is ...
4 years, 7 months ago (2016-05-11 08:16:31 UTC) #54
PhistucK
On 2016/05/11 at 08:16:31, timloh wrote: > On 2016/05/11 08:12:44, PhistucK wrote: > > But ...
4 years, 7 months ago (2016-05-11 08:20:20 UTC) #55
Noel Gordon
On 2016/05/11 08:20:20, PhistucK wrote: > On 2016/05/11 at 08:16:31, timloh wrote: > > On ...
4 years, 7 months ago (2016-05-12 01:54:57 UTC) #56
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/80001
4 years, 7 months ago (2016-05-12 01:57:15 UTC) #58
Noel Gordon
https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/hex-colors.html File third_party/WebKit/LayoutTests/fast/css/hex-colors.html (right): https://codereview.chromium.org/1936913002/diff/60001/third_party/WebKit/LayoutTests/fast/css/hex-colors.html#newcode1 third_party/WebKit/LayoutTests/fast/css/hex-colors.html:1: <script> On 2016/05/11 07:23:08, Timothy Loh wrote: > This ...
4 years, 7 months ago (2016-05-12 01:59:26 UTC) #59
Noel Gordon
On 2016/05/11 08:16:31, Timothy Loh wrote: > > 1010 and 00101010 are both <number-token>s. ff10 ...
4 years, 7 months ago (2016-05-12 02:12:49 UTC) #60
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-12 03:18:32 UTC) #62
Timothy Loh
On 2016/05/12 02:12:49, noel gordon wrote: > On 2016/05/11 08:16:31, Timothy Loh wrote: > > ...
4 years, 7 months ago (2016-05-12 03:42:35 UTC) #63
Noel Gordon
Ok, and the previous if needs work too by the looks (could be quirks or ...
4 years, 7 months ago (2016-05-12 05:05:12 UTC) #64
Timothy Loh
On 2016/05/12 05:05:12, noel gordon wrote: > Ok, and the previous if needs work too ...
4 years, 7 months ago (2016-05-12 05:49:24 UTC) #65
Noel Gordon
On 2016/05/12 05:49:24, Timothy Loh wrote: > On 2016/05/12 05:05:12, noel gordon wrote: > > ...
4 years, 7 months ago (2016-05-12 06:16:20 UTC) #66
Noel Gordon
On 2016/05/12 03:42:35, Timothy Loh wrote: > On 2016/05/12 02:12:49, noel gordon wrote: > > ...
4 years, 7 months ago (2016-05-12 06:30:53 UTC) #67
Noel Gordon
Updated change description about the quirks mode change to fastParseColorInternal().
4 years, 7 months ago (2016-05-12 06:50:49 UTC) #70
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/100001
4 years, 7 months ago (2016-05-12 06:51:31 UTC) #72
Timothy Loh
https://codereview.chromium.org/1936913002/diff/100001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html File third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html (right): https://codereview.chromium.org/1936913002/diff/100001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html#newcode213 third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html:213: </script> Test for fast path? e.g. make a div ...
4 years, 7 months ago (2016-05-12 06:56:08 UTC) #73
Noel Gordon
On 2016/05/12 05:49:24, Timothy Loh wrote: > Eventually we're just going to try and make ...
4 years, 7 months ago (2016-05-12 07:24:21 UTC) #74
Timothy Loh
On 2016/05/12 07:24:21, noel gordon wrote: > On 2016/05/12 05:49:24, Timothy Loh wrote: > > ...
4 years, 7 months ago (2016-05-12 07:25:14 UTC) #75
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-12 08:04:52 UTC) #77
Noel Gordon
On 2016/05/12 06:56:08, Timothy Loh wrote: > https://codereview.chromium.org/1936913002/diff/100001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html > File third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html (right): > > https://codereview.chromium.org/1936913002/diff/100001/third_party/WebKit/LayoutTests/fast/css/parsing-color-quirk.html#newcode213 ...
4 years, 7 months ago (2016-05-12 08:40:07 UTC) #79
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/120001
4 years, 7 months ago (2016-05-12 08:40:44 UTC) #81
Timothy Loh
On 2016/05/12 08:40:07, noel gordon wrote: > On 2016/05/12 06:56:08, Timothy Loh wrote: > > ...
4 years, 7 months ago (2016-05-12 08:42:09 UTC) #82
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-12 09:50:32 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1936913002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1936913002/120001
4 years, 7 months ago (2016-05-13 02:55:31 UTC) #87
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 7 months ago (2016-05-13 03:03:20 UTC) #89
commit-bot: I haz the power
4 years, 7 months ago (2016-05-13 03:04:33 UTC) #91
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/bd42b3e0e1e52b1cbfe630ac7a4c230779111682
Cr-Commit-Position: refs/heads/master@{#393438}

Powered by Google App Engine
This is Rietveld 408576698