Bug 39457

Summary: REGRESSION(r53637): DivX plug-in fails to start until window is resized
Product: WebKit Reporter: Jon Honeycutt <jhoneycutt>
Component: Plug-insAssignee: Jon Honeycutt <jhoneycutt>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://www.divx.com/fr/software/download/installed/chromium
Attachments:
Description Flags
patch
none
patch v2 simon.fraser: review+

Description Jon Honeycutt 2010-05-20 16:47:15 PDT
The video on the page above doesn't start playing until the window is resized.

<rdar://problem/8006102>
Comment 1 Jon Honeycutt 2010-05-20 17:44:02 PDT
Created attachment 56652 [details]
patch
Comment 2 Simon Fraser (smfr) 2010-05-20 18:26:32 PDT
Comment on attachment 56652 [details]
patch

> diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
> index 96fa9e4..baef667 100644
> --- a/WebCore/plugins/win/PluginViewWin.cpp
> +++ b/WebCore/plugins/win/PluginViewWin.cpp
> @@ -610,6 +610,9 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
>      if (context->paintingDisabled())
>          return;
>  
> +    // Ensure that we have called SetWindow before we try to paint.
> +    setNPWindowRect(frameRect());

Plugins may do significant work every time setWindow() is called. Can we be smarter about detecting when it needs to be called (e.g .by remembering the last frameRect that we called it with)?
Comment 3 Jon Honeycutt 2010-05-20 19:02:41 PDT
(In reply to comment #2)
> (From update of attachment 56652 [details])
> > diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
> > index 96fa9e4..baef667 100644
> > --- a/WebCore/plugins/win/PluginViewWin.cpp
> > +++ b/WebCore/plugins/win/PluginViewWin.cpp
> > @@ -610,6 +610,9 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
> >      if (context->paintingDisabled())
> >          return;
> >  
> > +    // Ensure that we have called SetWindow before we try to paint.
> > +    setNPWindowRect(frameRect());
> 
> Plugins may do significant work every time setWindow() is called. Can we be smarter about detecting when it needs to be called (e.g .by remembering the last frameRect that we called it with)?

I'm not sure why setNPWindowRect() doesn't already do this, but I'm wary about changing that. To fix this bug, it should only be necessary to call setNPWindowRect here if we haven't called NPP_SetWindow yet. I'll update the patch to do that.
Comment 4 Jon Honeycutt 2010-05-20 19:18:36 PDT
Created attachment 56661 [details]
patch v2
Comment 5 Jon Honeycutt 2010-05-20 20:21:20 PDT
Landed in r59904.