diff options
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 2abafb0..9528490 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -84,8 +84,10 @@ void WebPluginProxy::Invalidate() { } void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { - // Ignore NPN_InvalidateRect calls with empty rects. - if (rect.IsEmpty()) + // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an + // invalidate if it's outside the clipping region, since if we did it won't + // lead to a paint and we'll be stuck waiting forever for a DidPaint response. + if (rect.IsEmpty() || !delegate_->clip_rect().Intersects(rect)) return; damaged_rect_ = damaged_rect_.Union(rect); diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index fe4743c..7ef9d80 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -78,6 +78,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { void* notify_data); bool windowless() const { return windowless_ ; } gfx::Rect rect() const { return window_rect_; } + gfx::Rect clip_rect() const { return clip_rect_; } enum PluginQuirks { PLUGIN_QUIRK_SETWINDOW_TWICE = 1, |