WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
27613
WebCore/page/ContextMenuController.cpp does not conform to style standards
https://bugs.webkit.org/show_bug.cgi?id=27613
Summary
WebCore/page/ContextMenuController.cpp does not conform to style standards
Mike Fenton
Reported
2009-07-23 12:03:09 PDT
cpplint reports a number of valid style fixes that should be made to WebCore/page/ContextMenuController.cpp.
Attachments
Style patch for ContextMenuController.cpp
(18.30 KB, patch)
2009-07-23 12:07 PDT
,
Mike Fenton
levin
: review-
Details
Formatted Diff
Diff
Replacement patch for ContextMenuController.cpp style fixes.
(18.76 KB, patch)
2009-07-29 07:36 PDT
,
Mike Fenton
levin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Mike Fenton
Comment 1
2009-07-23 12:07:59 PDT
Created
attachment 33350
[details]
Style patch for ContextMenuController.cpp
Eric Seidel (no email)
Comment 2
2009-07-23 23:14:17 PDT
Comment on
attachment 33350
[details]
Style patch for ContextMenuController.cpp This would be much easier to read if we had a white-space ignoring diff. It's difficult for me to tell that you haven' actually changed any code here. :(
Mike Fenton
Comment 3
2009-07-24 05:06:11 PDT
The main change in the patch is to fix the indentation of the case statements. It also fixes the include order and a few whitespace at end of line fixes.
David Levin
Comment 4
2009-07-28 11:21:59 PDT
Comment on
attachment 33350
[details]
Style patch for ContextMenuController.cpp
> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog > +2009-07-23 Mike Fenton <
mike.fenton@torchmobile.com
> > + > + Reviewed by NOBODY (OOPS!). > + > + Update WebCore/page/ContextMenuController.cpp to conform to WebKit > + Style Guidelines as identified by cpplint.py.
Now it is cpp_style.py :)
> diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
Since this is about fixing styling in ContextMenuController.cpp, Why not fix the indentation in this block of code? Personally, I would unwrap this line but you could just indent to the createWindow(. 107 static void openNewWindow(const KURL& urlToLoad, Frame* frame) 108 { 109 if (Page* oldPage = frame->page()) { 110 WindowFeatures features; 111 if (Page* newPage = oldPage->chrome()->createWindow(frame, 112 FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features)) 113 newPage->chrome()->show(); 114 } 115 }
> + case ContextMenuItemTagOpenFrameInNewWindow: { > + DocumentLoader* loader = frame->loader()->documentLoader(); > + if (!loader->unreachableURL().isEmpty()) > + openNewWindow(loader->unreachableURL(), frame); > + else > + openNewWindow(loader->url(), frame); > + break; > }
The indentation for the "}" needs fixing.
> + case ContextMenuItemTagSpellingGuess: > + ASSERT(frame->selectedText().length()); > + if (frame->editor()->shouldInsertText(item->title(), frame->selection()->toNormalizedRange().get(), > + EditorInsertActionPasted)) {
Either indent to the level of the nested paren or unwrap.
> + Document* document = frame->document(); > + RefPtr<ReplaceSelectionCommand> command = > + ReplaceSelectionCommand::create(document, createFragmentFromMarkup(document, item->title(), ""), > + true, false, true);
Either indent to the level of the nested paren or unwrap.
> + case ContextMenuItemTagOpenLink: > + if (Frame* targetFrame = result.targetFrame()) { > + targetFrame->loader()->loadFrameRequest(FrameLoadRequest(ResourceRequest(result.absoluteLinkURL(), > + frame->loader()->outgoingReferrer())), false, false, 0, 0);
Either indent to the level of the nested paren or unwrap.
Mike Fenton
Comment 5
2009-07-29 07:36:08 PDT
Created
attachment 33714
[details]
Replacement patch for ContextMenuController.cpp style fixes. Thanks for the review. This updated patch has all the noted changes corrected. Functions have been unwrapped and the indentation of the brace corrected.
David Levin
Comment 6
2009-07-29 09:33:08 PDT
Committed as
http://trac.webkit.org/changeset/46544
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