We should add template variants of CSSMutableStyleDeclaration::get{ShorthandValue, CommonValue, LayeredShorthandValue}() that are capable of determining the size of the passed array so that the caller does not need to provide such information. This helps improve the readability of the code (by removing redundant information) as well as makes usage of these functions less error prone (since the caller doesn't need to provide the size of the array). For completeness, we've used this technique before for functions RenderListMarker::to{Alphabetic, Numeric, Symbolic}.
Created attachment 84018 [details] Patch
Created attachment 84915 [details] Patch
Comment on attachment 84915 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=84915&action=review > Source/WebCore/css/CSSMutableStyleDeclaration.h:163 > + template <size_t size> String getShorthandValue(const int (&properties)[size]) const { return getShorthandValue(properties, size); } > + template <size_t size> String getCommonValue(const int (&properties)[size]) const { return getCommonValue(properties, size); } > + template <size_t size> String getLayeredShorthandValue(const int (&properties)[size]) const { return getLayeredShorthandValue(properties, size); } I like to leave out the space between “template” and “<” by analogy with function calls. Not sure others like that style.
(In reply to comment #3) > I like to leave out the space between “template” and “<” by analogy with function calls. Not sure others like that style. Will change before landing.
Committed r80620: <http://trac.webkit.org/changeset/80620>