Bug 1264968 part 2 - Allow persisting attributes of xul:window if its owner document is not root. r=enndeakin
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 25 Apr 2016 09:40:16 +0800
changeset 332598 660b322ef9fd22614359864cb2ebff3943511766
parent 332597 3663fe230f72ac37afbc25996cca6f2ef8794a4d
child 332599 2f34f0a20c58059be4ccac8f2023ca2a9defedd3
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1264968
milestone48.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 1264968 part 2 - Allow persisting attributes of xul:window if its owner document is not root. r=enndeakin MozReview-Commit-ID: 12rz0WMZp0L
dom/xul/XULDocument.cpp
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -909,16 +909,21 @@ XULDocument::AttributeWillChange(nsIDocu
         RemoveElementFromRefMap(aElement);
     }
 }
 
 static bool
 ShouldPersistAttribute(Element* aElement, nsIAtom* aAttribute)
 {
     if (aElement->IsXULElement(nsGkAtoms::window)) {
+        // This is not an element of the top document, its owner is
+        // not an nsXULWindow. Persist it.
+        if (aElement->OwnerDoc()->GetParentDocument()) {
+            return true;
+        }
         // The following attributes of xul:window should be handled in
         // nsXULWindow::SavePersistentAttributes instead of here.
         if (aAttribute == nsGkAtoms::screenX ||
             aAttribute == nsGkAtoms::screenY ||
             aAttribute == nsGkAtoms::width ||
             aAttribute == nsGkAtoms::height ||
             aAttribute == nsGkAtoms::sizemode) {
             return false;