Bug 39457 - REGRESSION(r53637): DivX plug-in fails to start until window is resized
: REGRESSION(r53637): DivX plug-in fails to start until window is resized
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: Plug-ins
: 528+ (Nightly build)
: PC Windows XP
: P2 Normal
Assigned To: Jon Honeycutt
http://www.divx.com/fr/software/downl...
: InRadar
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-20 16:47 PDT by Jon Honeycutt
Modified: 2010-05-20 20:21 PDT (History)
0 users

See Also:


Attachments
patch (3.32 KB, patch)
2010-05-20 17:44 PDT, Jon Honeycutt
no flags Details | Formatted Diff | Diff
patch v2 (5.03 KB, patch)
2010-05-20 19:18 PDT, Jon Honeycutt
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.