diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-29 12:18:48 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-29 12:18:57 +0100 |
commit | 4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064 (patch) | |
tree | bed2fe914fe0f7ec70abfb47d2d84af8a3604d09 /Source/WebCore/html/HTMLPlugInImageElement.cpp | |
parent | 01485457c9a5da3f1121015afd25bb53af77662e (diff) | |
download | qtwebkit-4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064.tar.gz |
Imported WebKit commit c60cfe0fc09efd257aa0111d7b133b02deb8a63e (http://svn.webkit.org/repository/webkit/trunk@136119)
New snapshot that includes the fix for installing the QtWebProcess into libexec
Change-Id: I01344e079cbdac5678c4cba6ffcc05f4597cf0d7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLPlugInImageElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLPlugInImageElement.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp index b809a1340..421ac1b0f 100644 --- a/Source/WebCore/html/HTMLPlugInImageElement.cpp +++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp @@ -27,6 +27,7 @@ #include "HTMLImageLoader.h" #include "HTMLNames.h" #include "Image.h" +#include "MouseEvent.h" #include "NodeRenderStyle.h" #include "Page.h" #include "RenderEmbeddedObject.h" @@ -38,6 +39,9 @@ namespace WebCore { +// This delay should not exceed the snapshot delay in PluginView.cpp +static const double simulatedMouseClickTimerDelay = .75; + HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document* document, bool createdByParser, PreferPlugInsForImagesOption preferPlugInsForImagesOption) : HTMLPlugInElement(tagName, document) // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay @@ -47,6 +51,7 @@ HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Doc , m_needsWidgetUpdate(!createdByParser) , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages) , m_needsDocumentActivationCallbacks(false) + , m_simulatedMouseClickTimer(this, &HTMLPlugInImageElement::simulatedMouseClickTimerFired, simulatedMouseClickTimerDelay) { setHasCustomCallbacks(); @@ -257,4 +262,26 @@ void HTMLPlugInImageElement::updateSnapshot(PassRefPtr<Image> image) setDisplayState(DisplayingSnapshot); } +void HTMLPlugInImageElement::setPendingClickEvent(PassRefPtr<MouseEvent> event) +{ + m_pendingClickEventFromSnapshot = event; +} + +void HTMLPlugInImageElement::dispatchPendingMouseClick() +{ + ASSERT(!m_simulatedMouseClickTimer.isActive()); + m_simulatedMouseClickTimer.restart(); +} + +void HTMLPlugInImageElement::simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>*) +{ + ASSERT(displayState() == PlayingWithPendingMouseClick); + ASSERT(m_pendingClickEventFromSnapshot); + + dispatchSimulatedClick(m_pendingClickEventFromSnapshot.get(), SendMouseOverUpDownEvents, DoNotShowPressedLook); + + setDisplayState(Playing); + m_pendingClickEventFromSnapshot = nullptr; +} + } // namespace WebCore |