Bug 163662

Summary: [CSS Parser] Fix named color parsing
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: CSSAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch zalan: review+

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]
Patch
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]
Patch

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.