Bug 163662 - [CSS Parser] Fix named color parsing
Summary: [CSS Parser] Fix named color parsing
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dave Hyatt
Depends on:
Reported: 2016-10-19 08:54 PDT by Dave Hyatt
Modified: 2016-10-19 10:34 PDT (History)
1 user (show)

See Also:

Patch (5.04 KB, patch)
2016-10-19 08:57 PDT, Dave Hyatt
zalan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2016-10-19 08:54:20 PDT
Named color parsing in the old parser for extended colors relied on constructing a Color with the name and doing a lookup that way. This was bad in that serialization on the back end loses the extended color name.

The new parser allows the back end to hold a primitive identifier value for extended colors (making serialization correct). StyleColor contains a helper function for looking up the correct color.

This patch switches both the old and the new parsers over to the new StyleColor function.
Comment 1 Dave Hyatt 2016-10-19 08:57:19 PDT
Created attachment 292067 [details]
Comment 2 WebKit Commit Bot 2016-10-19 08:59:49 PDT
Attachment 292067 [details] did not pass style-queue:

ERROR: Source/WebCore/css/StyleResolver.cpp:123:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 3 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dave Hyatt 2016-10-19 09:41:34 PDT
Landed in r207539.
Comment 4 Darin Adler 2016-10-19 10:34:20 PDT
Comment on attachment 292067 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=292067&action=review

> Source/WebCore/css/StyleResolver.cpp:1817
> +    default: {
> +        return StyleColor::colorFromKeyword(ident);
> +    }

No need for these braces.