Bug 57045 - Eliminate Node::dispatchGenericEvent.
Summary: Eliminate Node::dispatchGenericEvent.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Dimitri Glazkov (Google)
URL:
Keywords:
Depends on:
Blocks: 55515
  Show dependency treegraph
 
Reported: 2011-03-24 12:50 PDT by Dimitri Glazkov (Google)
Modified: 2011-03-24 19:34 PDT (History)
3 users (show)

See Also:


Attachments
Patch (5.84 KB, patch)
2011-03-24 12:52 PDT, Dimitri Glazkov (Google)
no flags Details | Formatted Diff | Diff
Removed unnecessary extra ref and stale comment. (6.46 KB, patch)
2011-03-24 13:01 PDT, Dimitri Glazkov (Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2011-03-24 12:50:06 PDT
Eliminate Node::dispatchGenericEvent.
Comment 1 Dimitri Glazkov (Google) 2011-03-24 12:52:06 PDT
Created attachment 86814 [details]
Patch
Comment 2 Dimitri Glazkov (Google) 2011-03-24 13:01:12 PDT
Created attachment 86816 [details]
Removed unnecessary extra ref and stale comment.
Comment 3 Dimitri Glazkov (Google) 2011-03-24 16:31:25 PDT
Comment on attachment 86816 [details]
Removed unnecessary extra ref and stale comment.

commit queue should do it, for safety.
Comment 4 Darin Adler 2011-03-24 17:21:39 PDT
Comment on attachment 86816 [details]
Removed unnecessary extra ref and stale comment.

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

Wow, this is a really great thing to do. Who on earth every understood the difference between dispatchGenericEvent and dispatchEvent!?

> Source/WebCore/dom/Node.cpp:2699
> +    RefPtr<FrameView> view = document()->view();

Since this is never used, I think this should be named protectView instead of just view. I also think it makes sense to put this with the other protect before doing any work with the event.

> Source/WebCore/svg/SVGElementInstance.cpp:142
>      SVGElement* element = shadowTreeElement();
>      if (!element)
>          return false;
>  
> -    RefPtr<FrameView> view = element->document()->view();
> -    return element->dispatchGenericEvent(event.release());
> +    return element->dispatchEvent(event);

I can’t resist pointing out the way I like to write these:

    SVGElement* element = shadowTreeElement();
    return element && element->dispatchEvent(event);

But I will set commit-queue+ anyway, because it probably is clearer the way it’s written here anyway.
Comment 5 WebKit Commit Bot 2011-03-24 19:34:47 PDT
Comment on attachment 86816 [details]
Removed unnecessary extra ref and stale comment.

Clearing flags on attachment: 86816

Committed r81932: <http://trac.webkit.org/changeset/81932>
Comment 6 WebKit Commit Bot 2011-03-24 19:34:53 PDT
All reviewed patches have been landed.  Closing bug.