Bug 610057. Sizemode attribute is incorrect in windows which are not set to persist the attribute (e.g. popup windows). r=neil a=blocking-final
authorFelipe Gomes <felipc@gmail.com>
Mon, 20 Dec 2010 13:59:48 -0800
changeset 59528 34f521036d9dc49a0fcdcfe8a711c19009915a72
parent 59527 8777141fa716f8679959c8d7d60892a9b4a52831
child 59529 b71a05bcd2f5a7ae95e442fb484fb1715209c267
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersneil, blocking-final
bugs610057
milestone2.0b9pre
Bug 610057. Sizemode attribute is incorrect in windows which are not set to persist the attribute (e.g. popup windows). r=neil a=blocking-final
xpfe/appshell/src/nsXULWindow.cpp
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -1514,26 +1514,25 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
       sizeString.AssignWithConversion(sizeBuf);
       docShellElement->SetAttribute(HEIGHT_ATTRIBUTE, sizeString);
       if (ownerXULDoc)
         ownerXULDoc->Persist(windowElementId, HEIGHT_ATTRIBUTE);
     }
   }
 
   if (mPersistentAttributesDirty & PAD_MISC) {
-    if (sizeMode != nsSizeMode_Minimized &&
-        persistString.Find("sizemode") >= 0) {
+    if (sizeMode != nsSizeMode_Minimized) {
       if (sizeMode == nsSizeMode_Maximized)
         sizeString.Assign(SIZEMODE_MAXIMIZED);
       else if (sizeMode == nsSizeMode_Fullscreen)
         sizeString.Assign(SIZEMODE_FULLSCREEN);
       else
         sizeString.Assign(SIZEMODE_NORMAL);
       docShellElement->SetAttribute(MODE_ATTRIBUTE, sizeString);
-      if (ownerXULDoc)
+      if (ownerXULDoc && persistString.Find("sizemode") >= 0)
         ownerXULDoc->Persist(windowElementId, MODE_ATTRIBUTE);
     }
     if (persistString.Find("zlevel") >= 0) {
       PRUint32 zLevel;
       nsCOMPtr<nsIWindowMediator> mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
       if (mediator) {
         mediator->GetZLevel(this, &zLevel);
         PR_snprintf(sizeBuf, sizeof(sizeBuf), "%lu", (unsigned long)zLevel);