Bug 801763. Don't try to update geometry for plugin widgets with no parent. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 17 Oct 2012 17:51:57 +1300
changeset 110643 3d48c911df8d7cda4de0bb189d08290cf19b053f
parent 110642 5378ee5b79b22a6907fcaa9157cf33581a9b373c
child 110644 0f2858ae977f5def0fd983b1abd7ca8705876d1b
push id23704
push useremorley@mozilla.com
push dateThu, 18 Oct 2012 17:12:58 +0000
treeherdermozilla-central@3779eb3f036f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs801763
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 801763. Don't try to update geometry for plugin widgets with no parent. r=mats
dom/bindings/BindingGen.py
layout/generic/nsObjectFrame.h
--- a/layout/generic/nsObjectFrame.h
+++ b/layout/generic/nsObjectFrame.h
@@ -115,16 +115,24 @@ public:
     mNextConfigurationClipRegion.Clear();
   }
   /**
    * Append the desired widget configuration to aConfigurations.
    */
   void GetWidgetConfiguration(nsTArray<nsIWidget::Configuration>* aConfigurations)
   {
     if (mWidget) {
+      if (!mWidget->GetParent()) {
+        // Plugin widgets should not be toplevel except when they're out of the
+        // document, in which case the plugin should not be registered for
+        // geometry updates and this should not be called. But apparently we
+        // have bugs where mWidget sometimes is toplevel here. Bail out.
+        NS_ERROR("Plugin widgets registered for geometry updates should not be toplevel");
+        return;
+      }
       nsIWidget::Configuration* configuration = aConfigurations->AppendElement();
       configuration->mChild = mWidget;
       configuration->mBounds = mNextConfigurationBounds;
       configuration->mClipRegion = mNextConfigurationClipRegion;
     }
   }
   /**
    * Called after all widget position/size/clip regions have been changed