Re: [webkit-dev] RenderStyleConstants.h - enum naming conventions?
On Fri, Aug 24, 2012 at 3:06 PM, Glenn Adams wrote: > [or if there is a name conflict on LineBreak, then will use LineBreakType] > (whether the suffice 'Type' is included also seems somewhat irregular) > s/suffice/suffix/ ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] RenderStyleConstants.h - enum naming conventions?
On Fri, Aug 24, 2012 at 2:58 PM, Eric Seidel wrote: > 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:53 PM, Glenn Adams wrote: > >> enum LineBreak { LineBreakAuto, LineBreakLoose, LineBreakNormal, > >> LineBreakStrict, LineBreakAfterWhiteSpace }; > Thanks, I will take that as a +1 to go with changing EKHTMLLineBreak to: enum LineBreak { LineBreakAuto, LineBreakLoose, LineBreakNormal, LineBreakStrict, LineBreakAfterWhiteSpace }; [or if there is a name conflict on LineBreak, then will use LineBreakType] (whether the suffice 'Type' is included also seems somewhat irregular) ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] RenderStyleConstants.h - enum naming conventions?
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 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 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@lists.webkit.org >> http://lists.webkit.org/mailman/listinfo/webkit-dev >> ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] RenderStyleConstants.h - enum naming conventions?
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 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@lists.webkit.org > http://lists.webkit.org/mailman/listinfo/webkit-dev > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev
[webkit-dev] RenderStyleConstants.h - enum naming conventions?
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@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-dev