Bug 70867 - Use enum instead of bool to represent -webkit-column-span property.
Summary: Use enum instead of bool to represent -webkit-column-span property.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luke Macpherson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 20:09 PDT by Luke Macpherson
Modified: 2011-10-28 12:15 PDT (History)
2 users (show)

See Also:


Attachments
Patch (9.10 KB, patch)
2011-10-25 20:12 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macpherson 2011-10-25 20:09:41 PDT
Use enum instead of bool to represent -webkit-column-span property.
Comment 1 Luke Macpherson 2011-10-25 20:12:42 PDT
Created attachment 112443 [details]
Patch
Comment 2 Darin Adler 2011-10-26 09:52:58 PDT
Comment on attachment 112443 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=112443&action=review

> Source/WebCore/rendering/style/RenderStyleConstants.h:86
> +enum ColumnSpan { ColumnSpanOne = 0, ColumnSpanAll};

Not sure I see the value in specifying "= 0" here and not specifying "= 1". I’d leave off the "= 0" myself.
Comment 3 Luke Macpherson 2011-10-27 16:29:45 PDT
Comment on attachment 112443 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=112443&action=review

>> Source/WebCore/rendering/style/RenderStyleConstants.h:86
>> +enum ColumnSpan { ColumnSpanOne = 0, ColumnSpanAll};
> 
> Not sure I see the value in specifying "= 0" here and not specifying "= 1". I’d leave off the "= 0" myself.

The reason I do it this way is to make the behavior clear when used in logical statements.
I'm not sure that the C++ spec defines the first enum value to be zero, even though most compilers do generate values that way.
By doing this I am trying to express that ColumSpanOne is always logically false, and ColumnSpanAll is logically true (!0).

Is that logic flawed? It seems to come up in reviews from time to time.
Comment 4 WebKit Review Bot 2011-10-28 12:15:43 PDT
Comment on attachment 112443 [details]
Patch

Clearing flags on attachment: 112443

Committed r98748: <http://trac.webkit.org/changeset/98748>
Comment 5 WebKit Review Bot 2011-10-28 12:15:47 PDT
All reviewed patches have been landed.  Closing bug.