[webkit-dev] RenderStyleConstants.h - enum naming conventions?

Eric Seidel eric at webkit.org
Thu Aug 23 23:58:37 PDT 2012


Sorry, I was unclear.  I haven't seen someone create a new enum using
E in years.  LineBreakType or similar would be better than
ELineBreakType.

On Thu, Aug 23, 2012 at 11:57 PM, Eric Seidel <eric at webkit.org> wrote:
> 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