[Webkit-unassigned] [Bug 27613] WebCore/page/ContextMenuController.cpp does not conform to style standards

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 28 11:22:00 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27613


David Levin <levin at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33350|review?                     |review-
               Flag|                            |




--- Comment #4 from David Levin <levin at chromium.org>  2009-07-28 11:21:59 PDT ---
(From update of attachment 33350)
> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> +2009-07-23  Mike Fenton  <mike.fenton at 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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list