WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 117620
Clicking on snapshotting plug-ins does not restart them
https://bugs.webkit.org/show_bug.cgi?id=117620
Summary
Clicking on snapshotting plug-ins does not restart them
Dean Jackson
Reported
2013-06-13 17:58:21 PDT
If a plug-in is snapshotting and the user clicks on it, it should immediately restart. <
rdar://problem/13821729
>
Attachments
Patch
(2.26 KB, patch)
2013-06-13 18:01 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(3.86 KB, patch)
2013-06-13 18:15 PDT
,
Dean Jackson
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Dean Jackson
Comment 1
2013-06-13 18:01:49 PDT
Created
attachment 204657
[details]
Patch
Dean Jackson
Comment 2
2013-06-13 18:05:58 PDT
Comment on
attachment 204657
[details]
Patch Ignore this. I tried to sneak it by but it is bad coding.
Darin Adler
Comment 3
2013-06-13 18:08:41 PDT
Comment on
attachment 204657
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=204657&action=review
> Source/WebCore/html/HTMLPlugInElement.cpp:223 > + if (displayState() == WaitingForSnapshot && event->type() == eventNames().clickEvent && isPlugInImageElement()) { > + MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); > + if (mouseEvent->button() == LeftButton) { > + toHTMLPlugInImageElement(this)->userDidClickSnapshot(mouseEvent, false); > + event->setDefaultHandled(); > + return; > + } > + }
defaultEventHandler is a virtual function. Why not put this code in the HTMLPlugInImageElement class in the first place instead of down casting?
Dean Jackson
Comment 4
2013-06-13 18:15:25 PDT
Created
attachment 204658
[details]
Patch
Dean Jackson
Comment 5
2013-06-13 18:17:59 PDT
(In reply to
comment #3
)
> (From update of
attachment 204657
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=204657&action=review
> > > Source/WebCore/html/HTMLPlugInElement.cpp:223 > > + if (displayState() == WaitingForSnapshot && event->type() == eventNames().clickEvent && isPlugInImageElement()) { > > + MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); > > + if (mouseEvent->button() == LeftButton) { > > + toHTMLPlugInImageElement(this)->userDidClickSnapshot(mouseEvent, false); > > + event->setDefaultHandled(); > > + return; > > + } > > + } > > defaultEventHandler is a virtual function. Why not put this code in the HTMLPlugInImageElement class in the first place instead of down casting?
Yeah... that's what I ended up doing. I'll even admit I thought of doing it up front :(
Simon Fraser (smfr)
Comment 6
2013-06-13 18:18:15 PDT
Comment on
attachment 204658
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=204658&action=review
> Source/WebCore/html/HTMLPlugInImageElement.cpp:716 > + if (displayState() == WaitingForSnapshot && event->type() == eventNames().clickEvent && isPlugInImageElement()) {
I think this would be slightly clearer if you did the event->type() last.
Dean Jackson
Comment 7
2013-06-13 18:21:05 PDT
Committed
r151576
: <
http://trac.webkit.org/changeset/151576
>
Darin Adler
Comment 8
2013-06-13 18:21:28 PDT
Comment on
attachment 204658
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=204658&action=review
> Source/WebCore/html/HTMLPlugInElement.h:83 > + virtual void defaultEventHandler(Event*);
Should be protected, not public. And as long as you are touching it, should add OVERRIDE.
> Source/WebCore/html/HTMLPlugInImageElement.h:128 > + virtual void defaultEventHandler(Event*);
Should add OVERRIDE. Could be private instead of protected.
Dean Jackson
Comment 9
2013-06-14 10:10:50 PDT
Follow-up commit for Darin's comments:
https://trac.webkit.org/r151599
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