Bug 140556

Summary: Generate shorthandForProperty() implementation from CSSPropertyNames.in
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, dino, kling, koivisto, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 140501    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-01-16 12:29:12 PST
Generate shorthandForProperty() implementation from CSSPropertyNames.in. This is just a big switch() statement calling the right StylePropertyShorthand factory function for a given CSSPropertyID.
Comment 1 Chris Dumez 2015-01-16 12:54:12 PST
Created attachment 244791 [details]
Patch
Comment 2 Chris Dumez 2015-01-16 16:55:29 PST
Comment on attachment 244791 [details]
Patch

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

> Source/WebCore/css/makeprop.pl:977
> +# FIXME: CSSPropertyFont is currently an exception. It is hard-coded here

I filed https://bugs.webkit.org/show_bug.cgi?id=140577 fo this.
Comment 3 Darin Adler 2015-01-17 08:12:09 PST
Comment on attachment 244791 [details]
Patch

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

Some day we might want a table instead of a switch, if that proves to have better performance. If we know the numeric values of all the CSS property constants then we can just emit an array.

> Source/WebCore/css/makeprop.pl:964
> +    static NeverDestroyed<StylePropertyShorthand> emptyShorthand;

Seems like this could go right after the default: label instead of at the top of the function. Not sure it’s better, though. Or the empty shorthand could be a function, just like all the specific shorthands, rather than inlined here.
Comment 4 WebKit Commit Bot 2015-01-17 08:54:32 PST
Comment on attachment 244791 [details]
Patch

Clearing flags on attachment: 244791

Committed r178626: <http://trac.webkit.org/changeset/178626>
Comment 5 WebKit Commit Bot 2015-01-17 08:54:36 PST
All reviewed patches have been landed.  Closing bug.