diff options
Diffstat (limited to 'WebCore/plugins')
-rw-r--r-- | WebCore/plugins/PluginDatabase.cpp | 2 | ||||
-rw-r--r-- | WebCore/plugins/PluginPackage.cpp | 7 | ||||
-rw-r--r-- | WebCore/plugins/PluginView.cpp | 6 | ||||
-rw-r--r-- | WebCore/plugins/gtk/PluginViewGtk.cpp | 10 | ||||
-rw-r--r-- | WebCore/plugins/qt/PluginViewQt.cpp | 7 | ||||
-rw-r--r-- | WebCore/plugins/win/PluginViewWin.cpp | 16 |
6 files changed, 27 insertions, 21 deletions
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp index 77c84eb..2426f78 100644 --- a/WebCore/plugins/PluginDatabase.cpp +++ b/WebCore/plugins/PluginDatabase.cpp @@ -517,7 +517,7 @@ static bool readTime(time_t& resultTime, char*& start, const char* end) if (start + sizeof(time_t) >= end) return false; - resultTime = *reinterpret_cast<time_t*>(start); + resultTime = *reinterpret_cast_ptr<time_t*>(start); start += sizeof(time_t); return true; diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp index 168d45a..660d8f0 100644 --- a/WebCore/plugins/PluginPackage.cpp +++ b/WebCore/plugins/PluginPackage.cpp @@ -221,6 +221,13 @@ void PluginPackage::determineQuirks(const String& mimeType) m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages); m_quirks.add(PluginQuirkFlashURLNotifyBug); } + +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + // Passing a 32-bit depth pixmap to NPAPI plugins is too inefficient. Instead, pass a X Pixmap + // that has same depth as the screen depth since graphics operations are optimized + // for this depth. + m_quirks.add(PluginQuirkRequiresDefaultScreenDepth); +#endif } #endif diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp index d410948..c657523 100644 --- a/WebCore/plugins/PluginView.cpp +++ b/WebCore/plugins/PluginView.cpp @@ -182,9 +182,9 @@ void PluginView::handleEvent(Event* event) handleFocusEvent(true); #endif #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) - else if (event->type() == eventNames().DOMFocusOutEvent) + else if (event->type() == eventNames().DOMFocusOutEvent || event->type() == eventNames().focusoutEvent) handleFocusOutEvent(); - else if (event->type() == eventNames().DOMFocusInEvent) + else if (event->type() == eventNames().DOMFocusInEvent || event->type() == eventNames().focusinEvent) handleFocusInEvent(); #endif } @@ -562,7 +562,7 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame) return NPERR_INVALID_PARAM; - } else if (!SecurityOrigin::canLoad(url, String(), m_parentFrame->document())) + } else if (!SecurityOrigin::canDisplay(url, String(), m_parentFrame->document())) return NPERR_GENERIC_ERROR; PluginRequest* request = new PluginRequest(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed()); diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp index ab43bf4..6d631e3 100644 --- a/WebCore/plugins/gtk/PluginViewGtk.cpp +++ b/WebCore/plugins/gtk/PluginViewGtk.cpp @@ -33,6 +33,7 @@ #include "Document.h" #include "DocumentLoader.h" #include "Element.h" +#include "FocusController.h" #include "FrameLoader.h" #include "FrameLoadRequest.h" #include "FrameTree.h" @@ -299,6 +300,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event) NPEvent xEvent; #if defined(XP_UNIX) + initXEvent(&xEvent); GdkEventKey* gdkEvent = event->keyEvent()->gdkEventKey(); xEvent.type = (event->type() == eventNames().keydownEvent) ? 2 : 3; // KeyPress/Release get unset somewhere @@ -306,7 +308,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event) xEvent.xkey.subwindow = 0; // we have no child window xEvent.xkey.time = event->timeStamp(); xEvent.xkey.state = gdkEvent->state; // GdkModifierType mirrors xlib state masks - xEvent.xkey.keycode = gdkEvent->hardware_keycode; + xEvent.xkey.keycode = gdkEvent->keyval; xEvent.xkey.same_screen = true; // NOTE: As the XEvents sent to the plug-in are synthesized and there is not a native window @@ -421,6 +423,12 @@ void PluginView::handleMouseEvent(MouseEvent* event) if (m_isWindowed) return; + if (event->type() == eventNames().mousedownEvent) { + if (Page* page = m_parentFrame->page()) + page->focusController()->setActive(true); + focusPluginElement(); + } + NPEvent xEvent; #if defined(XP_UNIX) initXEvent(&xEvent); diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp index f60885d..e2df392 100644 --- a/WebCore/plugins/qt/PluginViewQt.cpp +++ b/WebCore/plugins/qt/PluginViewQt.cpp @@ -154,13 +154,6 @@ void PluginView::setFocus(bool focused) } else { Widget::setFocus(focused); } - if (!m_isWindowed) { - XEvent npEvent; - initXEvent(&npEvent); - npEvent.type = (focused) ? 9 : 10; // ints as Qt unsets FocusIn and FocusOut - if (!dispatchNPEvent(npEvent)) - LOG(Events, "PluginView::setFocus(%d): Focus event not accepted", focused); - } } void PluginView::show() diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp index 8dbb04b..84d2984 100644 --- a/WebCore/plugins/win/PluginViewWin.cpp +++ b/WebCore/plugins/win/PluginViewWin.cpp @@ -50,6 +50,7 @@ #include "JSDOMBinding.h" #include "JSDOMWindow.h" #include "KeyboardEvent.h" +#include "LocalWindowsContext.h" #include "MIMETypeRegistry.h" #include "MouseEvent.h" #include "Page.h" @@ -563,7 +564,7 @@ void PluginView::paintWindowedPluginIntoContext(GraphicsContext* context, const ASSERT(parent()->isFrameView()); IntPoint locationInWindow = static_cast<FrameView*>(parent())->contentsToWindow(frameRect().location()); - HDC hdc = context->getWindowsContext(frameRect(), false); + LocalWindowsContext windowsContext(context, frameRect(), false); #if PLATFORM(CAIRO) // Must flush drawings up to this point to the backing metafile, otherwise the @@ -573,6 +574,7 @@ void PluginView::paintWindowedPluginIntoContext(GraphicsContext* context, const cairo_show_page(ctx); #endif + HDC hdc = windowsContext.hdc(); XFORM originalTransform; GetWorldTransform(hdc, &originalTransform); @@ -587,8 +589,6 @@ void PluginView::paintWindowedPluginIntoContext(GraphicsContext* context, const paintIntoTransformedContext(hdc); SetWorldTransform(hdc, &originalTransform); - - context->releaseWindowsContext(hdc, frameRect(), false); #endif } @@ -617,7 +617,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) ASSERT(parent()->isFrameView()); IntRect rectInWindow = static_cast<FrameView*>(parent())->contentsToWindow(frameRect()); - HDC hdc = context->getWindowsContext(rectInWindow, m_isTransparent); + LocalWindowsContext windowsContext(context, rectInWindow, m_isTransparent); // On Safari/Windows without transparency layers the GraphicsContext returns the HDC // of the window and the plugin expects that the passed in DC has window coordinates. @@ -626,16 +626,14 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) #if !PLATFORM(QT) && !OS(WINCE) if (!context->inTransparencyLayer()) { XFORM transform; - GetWorldTransform(hdc, &transform); + GetWorldTransform(windowsContext.hdc(), &transform); transform.eDx = 0; transform.eDy = 0; - SetWorldTransform(hdc, &transform); + SetWorldTransform(windowsContext.hdc(), &transform); } #endif - paintIntoTransformedContext(hdc); - - context->releaseWindowsContext(hdc, frameRect(), m_isTransparent); + paintIntoTransformedContext(windowsContext.hdc()); } void PluginView::handleKeyboardEvent(KeyboardEvent* event) |