diff options
author | Grace Kloba <klobag@google.com> | 2010-03-25 23:15:06 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2010-03-26 11:44:07 -0700 |
commit | 74f79778892548221468d075f949acb3d4064368 (patch) | |
tree | ed5c1b1dde1c5a1b9e33bfc5ff3b1ad28410fc3c /WebCore/plugins | |
parent | 9b1bc61a6de534695c552094070e02a7b6331620 (diff) | |
download | external_webkit-74f79778892548221468d075f949acb3d4064368.zip external_webkit-74f79778892548221468d075f949acb3d4064368.tar.gz external_webkit-74f79778892548221468d075f949acb3d4064368.tar.bz2 |
In Android, as we always remap the plugin from page
space to view space, we do want to update when the rect
in the page space changed. This should fix the bug where
the plugin is inside a fixed position. So even its
page coordinate changed when scrolling, its window
coordinate didn't change. We missed the update.
Fix http://b/issue?id=2542934
Diffstat (limited to 'WebCore/plugins')
-rw-r--r-- | WebCore/plugins/PluginView.h | 3 | ||||
-rw-r--r-- | WebCore/plugins/android/PluginViewAndroid.cpp | 35 |
2 files changed, 21 insertions, 17 deletions
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h index 41e563c..f14eb3d 100644 --- a/WebCore/plugins/PluginView.h +++ b/WebCore/plugins/PluginView.h @@ -410,6 +410,9 @@ private: IntRect m_clipRect; // The clip rect to apply to a windowed plug-in IntRect m_windowRect; // Our window rect. +#ifdef ANDROID_PLUGINS + IntRect m_pageRect; // The rect in page coordinate system. +#endif bool m_loadManually; RefPtr<PluginStream> m_manualStream; diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp index 452c9fb..ee39687 100644 --- a/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/WebCore/plugins/android/PluginViewAndroid.cpp @@ -427,23 +427,17 @@ void PluginView::setNPWindowIfNeeded() return; // in Android, plugin always get the setwindow() in the page coordinate. - IntRect pageRect = m_windowRect; - ScrollView* top = parent(); - while (top->parent()) - top = top->parent(); - // only the top ScrollView can have the offset - pageRect.move(top->scrollOffset()); // the m_npWindow is relative to the page - m_npWindow.x = pageRect.x(); - m_npWindow.y = pageRect.y(); - m_npWindow.width = pageRect.width(); - m_npWindow.height = pageRect.height(); + m_npWindow.x = m_pageRect.x(); + m_npWindow.y = m_pageRect.y(); + m_npWindow.width = m_pageRect.width(); + m_npWindow.height = m_pageRect.height(); - m_npWindow.clipRect.left = pageRect.x(); - m_npWindow.clipRect.top = pageRect.y(); - m_npWindow.clipRect.right = pageRect.x() + pageRect.width(); - m_npWindow.clipRect.bottom = pageRect.y() + pageRect.height(); + m_npWindow.clipRect.left = m_pageRect.x(); + m_npWindow.clipRect.top = m_pageRect.y(); + m_npWindow.clipRect.right = m_pageRect.x() + m_pageRect.width(); + m_npWindow.clipRect.bottom = m_pageRect.y() + m_pageRect.height(); if (m_plugin->pluginFuncs()->setwindow) { #if USE(JSC) @@ -666,11 +660,18 @@ void PluginView::updatePluginWidget() FrameView* frameView = static_cast<FrameView*>(parent()); PLUGIN_LOG("--%p UpdatePluginWidget frame=[%p] \n", instance(), frameView); if (frameView) { - IntRect oldWindowRect = m_windowRect; - m_windowRect = frameView->contentsToWindow(frameRect()); - if (m_windowRect != oldWindowRect) + IntRect oldPageRect = m_pageRect; + + // only the top ScrollView can have the offset + m_pageRect = m_windowRect; + ScrollView* top = parent(); + while (top->parent()) + top = top->parent(); + m_pageRect.move(top->scrollOffset()); + + if (m_pageRect != oldPageRect) setNPWindowIfNeeded(); } } |