Backed out changeset 73958e9bfd07 (bug 1448574) for debug-marionette-e10s failing on unit/test_window_rect.py
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 28 Mar 2018 11:19:54 +0300
changeset 410345 33d9a28cbd16f204d968603fbb21933b8d83c9c4
parent 410344 3ac144929b5bbfc201acb504bec940dfc47d80e8
child 410346 8bd11028a413d1e533fbc54a80f75bd64b3daea0
push id61822
push usernbeleuzu@mozilla.com
push dateWed, 28 Mar 2018 08:20:44 +0000
treeherderautoland@33d9a28cbd16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1448574
milestone61.0a1
backs out73958e9bfd07b97e2030315ac61e4f2772ce3705
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
Backed out changeset 73958e9bfd07 (bug 1448574) for debug-marionette-e10s failing on unit/test_window_rect.py
xpfe/appshell/nsXULWindow.cpp
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1631,64 +1631,65 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
   nsCOMPtr<nsIBaseWindow> parent(do_QueryReferent(mParentWindow));
   if (parent && gotRestoredBounds) {
     int32_t parentX, parentY;
     if (NS_SUCCEEDED(parent->GetPosition(&parentX, &parentY))) {
       rect.MoveBy(-parentX, -parentY);
     }
   }
 
+  char                        sizeBuf[10];
   nsAutoString                sizeString;
   nsAutoString                windowElementId;
 
   // fetch docShellElement's ID and XUL owner document
   RefPtr<dom::XULDocument> ownerXULDoc =
     docShellElement->OwnerDoc()->AsXULDocument();
   if (docShellElement->IsXULElement()) {
     docShellElement->GetId(windowElementId);
   }
 
   bool shouldPersist = !isFullscreen && ownerXULDoc;
   ErrorResult rv;
   // (only for size elements which are persisted)
   if ((mPersistentAttributesDirty & PAD_POSITION) && gotRestoredBounds) {
     if (persistString.Find("screenX") >= 0) {
-      sizeString.Truncate();
-      sizeString.AppendInt(NSToIntRound(rect.X() / posScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.X() / posScale.scale));
+      CopyASCIItoUTF16(sizeBuf, sizeString);
       docShellElement->SetAttribute(SCREENX_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         IgnoredErrorResult err;
         ownerXULDoc->Persist(windowElementId, SCREENX_ATTRIBUTE, err);
       }
     }
     if (persistString.Find("screenY") >= 0) {
-      sizeString.Truncate();
-      sizeString.AppendInt(NSToIntRound(rect.Y() / posScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.Y() / posScale.scale));
+      CopyASCIItoUTF16(sizeBuf, sizeString);
       docShellElement->SetAttribute(SCREENY_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         IgnoredErrorResult err;
         ownerXULDoc->Persist(windowElementId, SCREENY_ATTRIBUTE, err);
       }
     }
   }
 
   if ((mPersistentAttributesDirty & PAD_SIZE) && gotRestoredBounds) {
     LayoutDeviceIntRect innerRect = rect - GetOuterToInnerSizeDifference(mWindow);
     if (persistString.Find("width") >= 0) {
-      sizeString.Truncate();
-      sizeString.AppendInt(NSToIntRound(innerRect.Width() / sizeScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(innerRect.Width() / sizeScale.scale));
+      CopyASCIItoUTF16(sizeBuf, sizeString);
       docShellElement->SetAttribute(WIDTH_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         IgnoredErrorResult err;
         ownerXULDoc->Persist(windowElementId, WIDTH_ATTRIBUTE, err);
       }
     }
     if (persistString.Find("height") >= 0) {
-      sizeString.Truncate();
-      sizeString.AppendInt(NSToIntRound(innerRect.Width() / sizeScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(innerRect.Height() / sizeScale.scale));
+      CopyASCIItoUTF16(sizeBuf, sizeString);
       docShellElement->SetAttribute(HEIGHT_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         IgnoredErrorResult err;
         ownerXULDoc->Persist(windowElementId, HEIGHT_ATTRIBUTE, err);
       }
     }
   }
 
@@ -1708,18 +1709,18 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
         ownerXULDoc->Persist(windowElementId, MODE_ATTRIBUTE, err);
       }
     }
     if (persistString.Find("zlevel") >= 0) {
       uint32_t zLevel;
       nsCOMPtr<nsIWindowMediator> mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
       if (mediator) {
         mediator->GetZLevel(this, &zLevel);
-        sizeString.Truncate();
-        sizeString.AppendInt(zLevel);
+        SprintfLiteral(sizeBuf, "%" PRIu32, zLevel);
+        CopyASCIItoUTF16(sizeBuf, sizeString);
         docShellElement->SetAttribute(ZLEVEL_ATTRIBUTE, sizeString, rv);
         if (shouldPersist) {
           IgnoredErrorResult err;
           ownerXULDoc->Persist(windowElementId, ZLEVEL_ATTRIBUTE, err);
         }
       }
     }
   }