Bug 618487 - Divx Web Player Videos won't play on Vidbux.com and Vidxden.com and Movshare.net. r=josh a=blocking2.0BetaN+
authorSteven Michaud <smichaud@pobox.com>
Mon, 20 Dec 2010 13:49:37 -0600
changeset 59526 1ff07ed94d79bff26a8ccbe901ddfa6d88c53eb3
parent 59525 608fc8fa26dc6fe38f7d91a4fdade24522ac7339
child 59527 8777141fa716f8679959c8d7d60892a9b4a52831
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjosh, blocking2
bugs618487
milestone2.0b9pre
Bug 618487 - Divx Web Player Videos won't play on Vidbux.com and Vidxden.com and Movshare.net. r=josh a=blocking2.0BetaN+
layout/generic/nsObjectFrame.cpp
layout/generic/nsObjectFrame.h
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1088,17 +1088,17 @@ nsObjectFrame::FixupWindow(const nsSize&
 #else
   mInstanceOwner->UpdateWindowPositionAndClipRect(PR_FALSE);
 #endif
 
   NotifyPluginReflowObservers();
 }
 
 nsresult
-nsObjectFrame::CallSetWindow()
+nsObjectFrame::CallSetWindow(PRBool aCheckIsHidden)
 {
   NPWindow *win = nsnull;
  
   nsresult rv = NS_ERROR_FAILURE;
   nsCOMPtr<nsIPluginInstance> pi; 
   if (!mInstanceOwner ||
       NS_FAILED(rv = mInstanceOwner->GetInstance(*getter_AddRefs(pi))) ||
       !pi ||
@@ -1106,17 +1106,17 @@ nsObjectFrame::CallSetWindow()
       !win)
     return rv;
 
   nsPluginNativeWindow *window = (nsPluginNativeWindow *)win;
 #ifdef XP_MACOSX
   mInstanceOwner->FixUpPluginWindow(ePluginPaintDisable);
 #endif
 
-  if (IsHidden())
+  if (aCheckIsHidden && IsHidden())
     return NS_ERROR_FAILURE;
 
   // refresh the plugin port as well
   window->window = mInstanceOwner->GetPluginPortFromWidget();
 
   // Adjust plugin dimensions according to pixel snap results
   // and reduce amount of SetWindow calls
   nsPresContext* presContext = PresContext();
@@ -3330,17 +3330,17 @@ NS_IMETHODIMP nsPluginInstanceOwner::Set
 #else
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif
 }
 
 NS_IMETHODIMP nsPluginInstanceOwner::SetWindow()
 {
   NS_ENSURE_TRUE(mObjectFrame, NS_ERROR_NULL_POINTER);
-  return mObjectFrame->CallSetWindow();
+  return mObjectFrame->CallSetWindow(PR_FALSE);
 }
 
 NPError nsPluginInstanceOwner::ShowNativeContextMenu(NPMenu* menu, void* event)
 {
   if (!menu || !event)
     return NPERR_GENERIC_ERROR;
 
 #ifdef XP_MACOSX
--- a/layout/generic/nsObjectFrame.h
+++ b/layout/generic/nsObjectFrame.h
@@ -216,17 +216,17 @@ protected:
    * Adjust the plugin's idea of its size, using aSize as its new size.
    * (aSize must be in twips)
    */
   void FixupWindow(const nsSize& aSize);
 
   /**
    * Sets up the plugin window and calls SetWindow on the plugin.
    */
-  nsresult CallSetWindow();
+  nsresult CallSetWindow(PRBool aCheckIsHidden = PR_TRUE);
 
   PRBool IsFocusable(PRInt32 *aTabIndex = nsnull, PRBool aWithMouse = PR_FALSE);
 
   // check attributes and optionally CSS to see if we should display anything
   PRBool IsHidden(PRBool aCheckVisibilityStyle = PR_TRUE) const;
 
   PRBool IsOpaque() const;