Bug 1264968 part 2 - Allow persisting attributes of xul:window if its owner document is not root. r?enn
MozReview-Commit-ID: 12rz0WMZp0L
--- 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;