WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
CLOSED FIXED
12313
Need code style guidelines for multi-line boolean expressions
https://bugs.webkit.org/show_bug.cgi?id=12313
Summary
Need code style guidelines for multi-line boolean expressions
David Kilzer (:ddkilzer)
Reported
2007-01-18 09:30:24 PST
The code style guidelines page on the web site needs style guidelines for multi-line boolean expressions per
Bug 12305 Comment #12
. Something to the effect of: Boolean expressions at the same nesting level that span multiple lines should have their operators on the left side of the line instead of the right side. Wrong: return attr->name() == srcAttr || attr->name() == lowsrcAttr || (attr->name() == usemapAttr && attr->value().domString()[0] != '#'); Right: return attr->name() == srcAttr || attr->name() == lowsrcAttr || (attr->name() == usemapAttr && attr->value().domString()[0] != '#');
Attachments
Patch for the issue
(1.49 KB, patch)
2008-07-17 06:11 PDT
,
Robert Blaut
ddkilzer
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Robert Blaut
Comment 1
2008-07-17 06:11:51 PDT
Created
attachment 22336
[details]
Patch for the issue
Robert Blaut
Comment 2
2008-07-18 06:52:19 PDT
After applying this patch WebKit will match Firefox and Opera behavior.
Robert Blaut
Comment 3
2008-07-18 06:53:22 PDT
(In reply to
comment #2
)
> After applying this patch WebKit will match Firefox and Opera behavior. >
This comment is in wrong place :(
David Kilzer (:ddkilzer)
Comment 4
2008-07-18 07:36:36 PDT
Comment on
attachment 22336
[details]
Patch for the issue I think 4 spaces for indenting the code is sufficient for the multi-line boolean expressions. I'd like Darin to comment on this as well since he may have a different perspective on where operators should go.
David Kilzer (:ddkilzer)
Comment 5
2008-07-18 07:38:03 PDT
Comment on
attachment 22336
[details]
Patch for the issue Oops! Reading the inspiration for this bug, I see Darin already made his opinion known. I will change the indentation to 4 spaces when I land the patch. Thanks Robert! r=me
David Kilzer (:ddkilzer)
Comment 6
2008-07-18 08:17:15 PDT
Committed
r35232
I also moved the item from "Other Punctuation" section up to the "Indentation" section since I thought it fit just a little better there.
Robert Blaut
Comment 7
2008-07-18 10:52:25 PDT
(In reply to
comment #6
)
> Committed
r35232
> > I also moved the item from "Other Punctuation" section up to the "Indentation" > section since I thought it fit just a little better there. >
Thank you for landing it. I wasn't sure where it should be placed so I chose "other punctuation".
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug