RESOLVED FIXED 140501
Generate StylePropertyShorthand.* from CSSPropertyNames.in
https://bugs.webkit.org/show_bug.cgi?id=140501
Summary Generate StylePropertyShorthand.* from CSSPropertyNames.in
Chris Dumez
Reported 2015-01-15 10:41:16 PST
Most of StylePropertyShorthand.* is boilerplate code that could easily be generated from CSSProperties.in file if we included in it the longhands for each shorthand property.
Attachments
Patch (64.02 KB, patch)
2015-01-15 15:37 PST, Chris Dumez
no flags
Patch (64.87 KB, patch)
2015-01-15 16:38 PST, Chris Dumez
no flags
Patch (64.90 KB, patch)
2015-01-15 16:53 PST, Chris Dumez
no flags
Patch (68.25 KB, patch)
2015-01-16 10:48 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-01-15 15:37:27 PST
Chris Dumez
Comment 2 2015-01-15 16:38:12 PST
Chris Dumez
Comment 3 2015-01-15 16:53:18 PST
Chris Dumez
Comment 4 2015-01-15 17:27:44 PST
Comment on attachment 244729 [details] Patch Patch is ready for review.
Darin Adler
Comment 5 2015-01-16 09:32:31 PST
Comment on attachment 244729 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244729&action=review > Source/WebCore/css/makeprop.pl:956 > + print SHORTHANDS_CPP " return StylePropertyShorthand(CSSProperty" . $nameToId{$name} . ", " . $lowercaseId . "Properties, WTF_ARRAY_LENGTH(" . $lowercaseId . "Properties));\n"; Seems like we could avoid this WTF_ARRAY_LENGTH if we made the constructor a template that takes an array and deduces its length, like StringBuilder::appendLiteral, for example. Anything that reduces the amount of generated code and puts more of the code in normal C++ header files seems like a win to me. To state the obvious, we want the code generator to generate things that need to be repeated but make the actual code generated as minimal as we can.
Chris Dumez
Comment 6 2015-01-16 10:48:23 PST
Chris Dumez
Comment 7 2015-01-16 11:28:20 PST
(In reply to comment #5) > Comment on attachment 244729 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=244729&action=review > > > Source/WebCore/css/makeprop.pl:956 > > + print SHORTHANDS_CPP " return StylePropertyShorthand(CSSProperty" . $nameToId{$name} . ", " . $lowercaseId . "Properties, WTF_ARRAY_LENGTH(" . $lowercaseId . "Properties));\n"; > > Seems like we could avoid this WTF_ARRAY_LENGTH if we made the constructor a > template that takes an array and deduces its length, like > StringBuilder::appendLiteral, for example. Anything that reduces the amount > of generated code and puts more of the code in normal C++ header files seems > like a win to me. To state the obvious, we want the code generator to > generate things that need to be repeated but make the actual code generated > as minimal as we can. I made the suggested change before landing.
WebKit Commit Bot
Comment 8 2015-01-16 11:39:01 PST
Comment on attachment 244773 [details] Patch Clearing flags on attachment: 244773 Committed r178586: <http://trac.webkit.org/changeset/178586>
WebKit Commit Bot
Comment 9 2015-01-16 11:39:07 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.