Backed out changeset 873acda091b7 (bug 1137009) for bc3 bustages ON A CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Wed, 09 Sep 2015 09:16:06 +0530
changeset 294076 76826fe33431103c1a888c0f35caf13439760a01
parent 294075 e9cb31373ec2bc63e3e35700a7c229ff97fe8f45
child 294077 e416ad732757e2ad493f4f1c2daae08b9c7538c1
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1137009
milestone43.0a1
backs out873acda091b75ba8aee7f374cd8e6c8627d64494
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 873acda091b7 (bug 1137009) for bc3 bustages ON A CLOSED TREE
dom/xul/XULDocument.cpp
xpfe/appshell/nsXULWindow.cpp
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -919,33 +919,16 @@ XULDocument::AttributeWillChange(nsIDocu
     // See if we need to update our ref map.
     if (aAttribute == nsGkAtoms::ref) {
         // Might not need this, but be safe for now.
         nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
         RemoveElementFromRefMap(aElement);
     }
 }
 
-static bool
-ShouldPersistAttribute(nsIDocument* aDocument, Element* aElement)
-{
-    if (aElement->IsXULElement(nsGkAtoms::window)) {
-        if (nsCOMPtr<nsPIDOMWindow> window = aDocument->GetWindow()) {
-            bool isFullscreen;
-            window->GetFullScreen(&isFullscreen);
-            if (isFullscreen) {
-                // Don't persist attributes if it is window element and
-                // we are in fullscreen state.
-                return false;
-            }
-        }
-    }
-    return true;
-}
-
 void
 XULDocument::AttributeChanged(nsIDocument* aDocument,
                               Element* aElement, int32_t aNameSpaceID,
                               nsIAtom* aAttribute, int32_t aModType,
                               const nsAttrValue* aOldValue)
 {
     NS_ASSERTION(aDocument == this, "unexpected doc");
 
@@ -1011,29 +994,28 @@ XULDocument::AttributeChanged(nsIDocumen
             }
         }
     }
 
     // checks for modifications in broadcasters
     bool listener, resolved;
     CheckBroadcasterHookup(aElement, &listener, &resolved);
 
-    if (ShouldPersistAttribute(aDocument, aElement)) {
-        // See if there is anything we need to persist in the localstore.
-        //
-        // XXX Namespace handling broken :-(
-        nsString persist;
-        aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::persist, persist);
-        if (!persist.IsEmpty() &&
-            // XXXldb This should check that it's a token, not just a substring.
-            persist.Find(nsDependentAtomString(aAttribute)) >= 0) {
+    // See if there is anything we need to persist in the localstore.
+    //
+    // XXX Namespace handling broken :-(
+    nsAutoString persist;
+    aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::persist, persist);
+    if (!persist.IsEmpty()) {
+        // XXXldb This should check that it's a token, not just a substring.
+        if (persist.Find(nsDependentAtomString(aAttribute)) >= 0) {
             nsContentUtils::AddScriptRunner(NS_NewRunnableMethodWithArgs
-                <nsIContent*, int32_t, nsIAtom*>
-                (this, &XULDocument::DoPersist, aElement,
-                 kNameSpaceID_None, aAttribute));
+              <nsIContent*, int32_t, nsIAtom*>
+              (this, &XULDocument::DoPersist, aElement, kNameSpaceID_None,
+               aAttribute));
         }
     }
 }
 
 void
 XULDocument::ContentAppended(nsIDocument* aDocument,
                              nsIContent* aContainer,
                              nsIContent* aFirstNewContent,
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1431,26 +1431,16 @@ void nsXULWindow::SyncAttributesToWidget
 
 NS_IMETHODIMP nsXULWindow::SavePersistentAttributes()
 {
   // can happen when the persistence timer fires at an inopportune time
   // during window shutdown
   if (!mDocShell)
     return NS_ERROR_FAILURE;
 
-  nsCOMPtr<nsIDOMWindow> domWindow;
-  GetWindowDOMWindow(getter_AddRefs(domWindow));
-  if (domWindow) {
-    bool isFullscreen;
-    domWindow->GetFullScreen(&isFullscreen);
-    if (isFullscreen) {
-      return NS_OK;
-    }
-  }
-
   nsCOMPtr<dom::Element> docShellElement = GetWindowDOMElement();
   if (!docShellElement)
     return NS_ERROR_FAILURE;
 
   nsAutoString   persistString;
   docShellElement->GetAttribute(PERSIST_ATTRIBUTE, persistString);
   if (persistString.IsEmpty()) { // quick check which sometimes helps
     mPersistentAttributesDirty = 0;