Changeset 151599 in webkit


Ignore:
Timestamp:
Jun 14, 2013, 10:09:49 AM (13 years ago)
Author:
dino@apple.com
Message:

Clicking on snapshotting plug-ins does not restart them
https://bugs.webkit.org/show_bug.cgi?id=117620
<rdar://problem/13821729>

Follow-up review comments from Darin Adler, with some
discussion on IRC.

Sprinkle OVERRIDE on virtual functions where needed. Also
make sure that the Event is a MouseEvent before casting to it.

  • html/HTMLPlugInElement.h: Move defaultEventHandler back to protected and add OVERRIDE.
  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::defaultEventHandler): Check for MouseEvent and
use toMouseEvent().

  • html/HTMLPlugInImageElement.h: Sprinkle some OVERRIDEs, and move defaultEventHandler

to private.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151598 r151599  
     12013-06-14  Dean Jackson  <dino@apple.com>
     2
     3        Clicking on snapshotting plug-ins does not restart them
     4        https://bugs.webkit.org/show_bug.cgi?id=117620
     5        <rdar://problem/13821729>
     6
     7        Follow-up review comments from Darin Adler, with some
     8        discussion on IRC.
     9
     10        Sprinkle OVERRIDE on virtual functions where needed. Also
     11        make sure that the Event is a MouseEvent before casting to it.
     12
     13        * html/HTMLPlugInElement.h: Move defaultEventHandler back to protected and add OVERRIDE.
     14        * html/HTMLPlugInImageElement.cpp:
     15        (WebCore::HTMLPlugInImageElement::defaultEventHandler): Check for MouseEvent and
     16        use toMouseEvent().
     17        * html/HTMLPlugInImageElement.h: Sprinkle some OVERRIDEs, and move defaultEventHandler
     18        to private.
     19
    1202013-06-14  Timothy Hatcher  <timothy@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLPlugInElement.h

    r151576 r151599  
    8181    virtual bool isPlugInImageElement() const { return false; }
    8282
    83     virtual void defaultEventHandler(Event*);
    84 
    8583protected:
    8684    HTMLPlugInElement(const QualifiedName& tagName, Document*);
     
    9189
    9290    virtual bool useFallbackContent() const { return false; }
     91
     92    virtual void defaultEventHandler(Event*) OVERRIDE;
    9393
    9494    // Subclasses should use guardedDispatchBeforeLoadEvent instead of calling dispatchBeforeLoadEvent directly.
     
    107107
    108108    virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
    109     virtual bool isPluginElement() const;
     109    virtual bool isPluginElement() const OVERRIDE;
    110110
    111111    RefPtr<JSC::Bindings::Instance> m_instance;
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r151576 r151599  
    714714    RenderObject* r = renderer();
    715715    if (r && r->isEmbeddedObject()) {
    716         if (isPlugInImageElement() && displayState() == WaitingForSnapshot && event->type() == eventNames().clickEvent) {
    717             MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
     716        if (isPlugInImageElement() && displayState() == WaitingForSnapshot && event->isMouseEvent() && event->type() == eventNames().clickEvent) {
     717            MouseEvent* mouseEvent = toMouseEvent(event);
    718718            if (mouseEvent->button() == LeftButton) {
    719719                userDidClickSnapshot(mouseEvent, true);
     
    725725    HTMLPlugInElement::defaultEventHandler(event);
    726726}
    727    
     727
    728728} // namespace WebCore
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r151576 r151599  
    126126    virtual bool isRestartedPlugin() const OVERRIDE { return m_isRestartedPlugin; }
    127127
    128     virtual void defaultEventHandler(Event*);
    129 
    130128private:
    131     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    132     virtual bool willRecalcStyle(StyleChange);
     129    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
     130    virtual bool willRecalcStyle(StyleChange) OVERRIDE;
    133131
    134132    void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE;
    135133
    136     virtual void finishParsingChildren();
     134    virtual void finishParsingChildren() OVERRIDE;
    137135
    138136    void updateWidgetIfNecessary();
     
    149147
    150148    void removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>*);
     149
     150    virtual void defaultEventHandler(Event*) OVERRIDE;
    151151
    152152    bool m_needsWidgetUpdate;
Note: See TracChangeset for help on using the changeset viewer.