Bug 140556 - Generate shorthandForProperty() implementation from CSSPropertyNames.in
Summary: Generate shorthandForProperty() implementation from CSSPropertyNames.in
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 140501
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-16 12:29 PST by Chris Dumez
Modified: 2015-01-17 08:54 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.60 KB, patch)
2015-01-16 12:54 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.