Merge backout
authorChris Jones <jones.chris.g@gmail.com>
Thu, 19 Aug 2010 19:03:00 -0500
changeset 50965 0a51470adf6a2dc433fdb2fa5ee6ef5b5276143e
parent 50963 4d836fb96f4c989eca956012f2a75e182b664d62 (current diff)
parent 50964 eceebfe296a7dba26de52ffbe02993a97cb6617b (diff)
child 50967 cab73e98bb54b2ca34d730333208cc84ea726eeb
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b5pre
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
Merge backout
view/src/nsView.cpp
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -683,35 +683,37 @@ nsresult nsView::CreateWidget(const nsII
     NS_ERROR("We already have a window for this view? BAD");
     ViewWrapper* wrapper = GetWrapperFor(mWindow);
     NS_IF_RELEASE(wrapper);
     mWindow->SetClientData(nsnull);
     mWindow->Destroy();
     NS_RELEASE(mWindow);
   }
 
-  PRBool initDataPassedIn = PR_TRUE;
-  nsWidgetInitData initData;
-  if (!aWidgetInitData) {
-    // No initData, we're a child window
-    initDataPassedIn = PR_FALSE;
-    initData.mWindowType = eWindowType_child;
-    initData.clipChildren = PR_TRUE;
-    initData.clipSiblings = PR_TRUE;
-    aWidgetInitData = &initData;
-  }
-  aWidgetInitData->mContentType = aContentType;
-
-  nsIntRect trect = CalcWidgetBounds(aWidgetInitData->mWindowType);
+  nsIntRect trect = CalcWidgetBounds(aWidgetInitData
+                                     ? aWidgetInitData->mWindowType
+                                     : eWindowType_child);
 
   if (NS_OK == LoadWidget(aWindowIID))
   {
     nsCOMPtr<nsIDeviceContext> dx;
     mViewManager->GetDeviceContext(*getter_AddRefs(dx));
 
+    PRBool initDataPassedIn = PR_TRUE;
+    nsWidgetInitData initData;
+    if (!aWidgetInitData) {
+      // No initData, we're a child window
+      // Create initData to pass in params
+      initDataPassedIn = PR_FALSE;
+      initData.clipChildren = PR_TRUE; // Clip child window's children
+      initData.clipSiblings = PR_TRUE; // Clip child window's siblings
+      aWidgetInitData = &initData;
+    }
+    aWidgetInitData->mContentType = aContentType;
+
     if (aNative && aWidgetInitData->mWindowType != eWindowType_popup)
       mWindow->Create(nsnull, aNative, trect, ::HandleEvent, dx, nsnull, nsnull, aWidgetInitData);
     else
     {
       if (!initDataPassedIn && GetParent() && 
           GetParent()->GetViewManager() != mViewManager)
         initData.mListenForResizes = PR_TRUE;
       if (aParentWidget) {