[webkit-dev] RenderStyleConstants.h - enum naming conventions?
Eric Seidel
eric at webkit.org
Thu Aug 23 23:57:41 PDT 2012
E is an old style from KHTML.
We should update our style guide to say more than it does. :)
"Enum members should user InterCaps with an initial capital letter.
[names-enum-members]"
On Thu, Aug 23, 2012 at 11:53 PM, Glenn Adams <glenn at skynav.com> wrote:
> I'm implementing a patch for [1], namely to support the CSS3 line-break
> property.
>
> [1] https://bugs.webkit.org/show_bug.cgi?id=89235
>
> There is an older -{khtml,webkit}-line-break enum EKHTMLLineBreak defined in
> RenderStyleConstants.h. I see that some enums use a 'E' prefix, while others
> do not, e.g.,
>
> enum ELineClampType { LineClampLineCount, LineClampPercentage };
>
> vs
>
> enum LineAlign { LineAlignNone, LineAlignEdges };
>
> plus, there appears to be a different convention for enum member names,
> e.g.,
>
> enum EKHTMLLineBreak { LBNORMAL, AFTER_WHITE_SPACE };
>
> Would it be better to have:
>
> enum LineBreak { LineBreakNormal, LineBreakAfterWhiteSpace };
>
> or, with the new keywords from CSS3 Text line-break, write this as:
>
> enum LineBreak { LineBreakAuto, LineBreakLoose, LineBreakNormal,
> LineBreakStrict, LineBreakAfterWhiteSpace };
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev
>
More information about the webkit-dev
mailing list