From bcebbd2882b4c04df6e6ab678da1411e2450eaa2 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Tue, 19 Nov 2013 07:35:17 -0800 Subject: [PATCH] Back out babac1cc0741:ad287f78608a (bug 939049) for OS X build bustage CLOSED TREE --- accessible/src/base/Logging.cpp | 30 +++--- .../src/base/nsAccessibilityService.cpp | 3 +- accessible/src/base/nsCoreUtils.cpp | 14 ++- accessible/src/generic/Accessible.cpp | 10 +- accessible/src/generic/DocAccessible.cpp | 9 +- content/base/public/nsIDocument.h | 22 ++-- content/base/src/moz.build | 1 - content/base/src/nsContentUtils.cpp | 20 ++-- content/base/src/nsDocument.cpp | 102 +++++++++--------- content/base/src/nsTreeSanitizer.cpp | 3 +- content/html/content/src/HTMLInputElement.cpp | 7 +- content/html/content/src/HTMLMediaElement.cpp | 9 +- content/html/document/src/ImageDocument.cpp | 5 +- content/html/document/src/moz.build | 1 - content/html/document/src/nsHTMLDocument.cpp | 4 +- content/xul/document/src/XULDocument.cpp | 9 +- content/xul/document/src/moz.build | 1 - docshell/base/nsDocShell.cpp | 10 +- docshell/base/nsDocShell.h | 4 +- docshell/base/nsIContentViewer.idl | 3 +- docshell/base/nsIDocumentLoaderFactory.idl | 5 +- docshell/shistory/src/nsSHEntryShared.cpp | 3 +- dom/ipc/TabChild.cpp | 3 +- dom/ipc/TabParent.cpp | 5 +- editor/composer/src/nsEditorSpellCheck.cpp | 3 +- editor/libeditor/base/nsEditorUtils.cpp | 3 +- .../text/nsPlaintextDataTransfer.cpp | 3 +- layout/base/moz.build | 3 - layout/base/nsDocumentViewer.cpp | 77 +++++++------ layout/base/nsPresContext.cpp | 4 +- layout/build/moz.build | 3 - layout/build/nsContentDLF.cpp | 11 +- layout/build/nsContentDLF.h | 4 +- layout/generic/nsSubDocumentFrame.cpp | 3 +- layout/printing/nsPrintEngine.cpp | 7 +- layout/printing/nsPrintEngine.h | 2 +- layout/style/nsFontFaceLoader.cpp | 23 ++-- layout/xul/base/src/nsContainerBoxObject.cpp | 9 +- layout/xul/base/src/nsXULPopupManager.cpp | 3 +- .../satchel/nsFormFillController.cpp | 5 +- .../prefetch/nsOfflineCacheUpdateService.cpp | 4 +- .../directory/nsDirectoryViewer.cpp | 3 +- 42 files changed, 241 insertions(+), 212 deletions(-) diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index 435b79f358b14..0e5b79629abc2 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -99,19 +99,22 @@ LogDocShellState(nsIDocument* aDocumentNode) printf("docshell busy: "); nsAutoCString docShellBusy; - nsCOMPtr docShell = aDocumentNode->GetDocShell(); - uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE; - docShell->GetBusyFlags(&busyFlags); - if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) - printf("'none'"); - if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY) - printf("'busy'"); - if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) - printf(", 'before page load'"); - if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) - printf(", 'page loading'"); - + nsCOMPtr container = aDocumentNode->GetContainer(); + if (container) { + nsCOMPtr docShell = do_QueryInterface(container); + uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE; + docShell->GetBusyFlags(&busyFlags); + if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE) + printf("'none'"); + if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY) + printf("'busy'"); + if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD) + printf(", 'before page load'"); + if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING) + printf(", 'page loading'"); + } else { printf("[failed]"); + } } static void @@ -129,7 +132,8 @@ static void LogDocShellTree(nsIDocument* aDocumentNode) { if (aDocumentNode->IsActive()) { - nsCOMPtr treeItem(aDocumentNode->GetDocShell()); + nsCOMPtr container = aDocumentNode->GetContainer(); + nsCOMPtr treeItem(do_QueryInterface(container)); nsCOMPtr parentTreeItem; treeItem->GetParent(getter_AddRefs(parentTreeItem)); nsCOMPtr rootTreeItem; diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 0ea3d82ef5f6c..5804fb435284c 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -200,7 +200,8 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell, nsIPresShell* ps = aPresShell; nsIDocument* documentNode = aPresShell->GetDocument(); if (documentNode) { - nsCOMPtr treeItem(documentNode->GetDocShell()); + nsCOMPtr container = documentNode->GetContainer(); + nsCOMPtr treeItem(do_QueryInterface(container)); if (treeItem) { nsCOMPtr rootTreeItem; treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); diff --git a/accessible/src/base/nsCoreUtils.cpp b/accessible/src/base/nsCoreUtils.cpp index 13aee385f1ff7..00ccb9a702aa7 100644 --- a/accessible/src/base/nsCoreUtils.cpp +++ b/accessible/src/base/nsCoreUtils.cpp @@ -394,14 +394,17 @@ nsCoreUtils::GetDocShellFor(nsINode *aNode) if (!aNode) return nullptr; - nsCOMPtr docShell = aNode->OwnerDoc()->GetDocShell(); + nsCOMPtr container = aNode->OwnerDoc()->GetContainer(); + nsCOMPtr docShell = do_QueryInterface(container); return docShell.forget(); } bool nsCoreUtils::IsRootDocument(nsIDocument *aDocument) { - nsCOMPtr docShellTreeItem = aDocument->GetDocShell(); + nsCOMPtr container = aDocument->GetContainer(); + nsCOMPtr docShellTreeItem = + do_QueryInterface(container); NS_ASSERTION(docShellTreeItem, "No document shell for document!"); nsCOMPtr parentTreeItem; @@ -413,7 +416,9 @@ nsCoreUtils::IsRootDocument(nsIDocument *aDocument) bool nsCoreUtils::IsContentDocument(nsIDocument *aDocument) { - nsCOMPtr docShellTreeItem = aDocument->GetDocShell(); + nsCOMPtr container = aDocument->GetContainer(); + nsCOMPtr docShellTreeItem = + do_QueryInterface(container); NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!"); int32_t contentType; @@ -424,7 +429,8 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument) bool nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode) { - nsCOMPtr treeItem(aDocumentNode->GetDocShell()); + nsCOMPtr container = aDocumentNode->GetContainer(); + nsCOMPtr treeItem(do_QueryInterface(container)); nsCOMPtr parentTreeItem; treeItem->GetParent(getter_AddRefs(parentTreeItem)); diff --git a/accessible/src/generic/Accessible.cpp b/accessible/src/generic/Accessible.cpp index b4c936579e2af..8f2ce0bdaff3f 100644 --- a/accessible/src/generic/Accessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -376,8 +376,10 @@ Accessible::AccessKey() const nsIDocument* document = mContent->GetCurrentDoc(); if (!document) return KeyBinding(); - - nsCOMPtr treeItem(document->GetDocShell()); + nsCOMPtr container = document->GetContainer(); + if (!container) + return KeyBinding(); + nsCOMPtr treeItem(do_QueryInterface(container)); if (!treeItem) return KeyBinding(); @@ -1291,7 +1293,9 @@ Accessible::NativeAttributes() nsCoreUtils::GetRoleContent(doc)); // Allow ARIA live region markup from outer documents to override - nsCOMPtr docShellTreeItem = doc->GetDocShell(); + nsCOMPtr container = doc->GetContainer(); + nsCOMPtr docShellTreeItem = + do_QueryInterface(container); if (!docShellTreeItem) break; diff --git a/accessible/src/generic/DocAccessible.cpp b/accessible/src/generic/DocAccessible.cpp index efc898ced63ae..909c41ab1ba70 100644 --- a/accessible/src/generic/DocAccessible.cpp +++ b/accessible/src/generic/DocAccessible.cpp @@ -688,7 +688,8 @@ DocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame) nsresult DocAccessible::AddEventListeners() { - nsCOMPtr docShellTreeItem(mDocumentNode->GetDocShell()); + nsCOMPtr container = mDocumentNode->GetContainer(); + nsCOMPtr docShellTreeItem(do_QueryInterface(container)); // We want to add a command observer only if the document is content and has // an editor. @@ -720,7 +721,8 @@ DocAccessible::RemoveEventListeners() if (mDocumentNode) { mDocumentNode->RemoveObserver(this); - nsCOMPtr docShellTreeItem(mDocumentNode->GetDocShell()); + nsCOMPtr container = mDocumentNode->GetContainer(); + nsCOMPtr docShellTreeItem(do_QueryInterface(container)); NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem."); if (docShellTreeItem) { @@ -1985,7 +1987,8 @@ DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible) bool DocAccessible::IsLoadEventTarget() const { - nsCOMPtr treeItem = mDocumentNode->GetDocShell(); + nsCOMPtr container = mDocumentNode->GetContainer(); + nsCOMPtr treeItem = do_QueryInterface(container); NS_ASSERTION(treeItem, "No document shell for document!"); nsCOMPtr parentTreeItem; diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 120ce2172efb9..1e94bb1fea7b7 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -20,7 +20,6 @@ #include "nsPropertyTable.h" // for member #include "nsTHashtable.h" // for member #include "mozilla/dom/DocumentBinding.h" -#include "mozilla/WeakPtr.h" #include "Units.h" #include "nsExpirationTracker.h" #include "nsClassHashtable.h" @@ -29,8 +28,6 @@ class imgIRequest; class nsAString; class nsBindingManager; class nsCSSStyleSheet; -class nsIDocShell; -class nsDocShell; class nsDOMNavigationTiming; class nsDOMTouchList; class nsEventStates; @@ -1153,23 +1150,22 @@ class nsIDocument : public nsINode * Set the container (docshell) for this document. Virtual so that * docshell can call it. */ - virtual void SetContainer(nsDocShell* aContainer); + virtual void SetContainer(nsISupports *aContainer); /** * Get the container (docshell) for this document. */ - nsISupports* GetContainer() const; + already_AddRefed GetContainer() const + { + nsCOMPtr container = do_QueryReferent(mDocumentContainer); + return container.forget(); + } /** * Get the container's load context for this document. */ nsILoadContext* GetLoadContext() const; - /** - * Get docshell the for this document. - */ - nsIDocShell* GetDocShell() const; - /** * Set and get XML declaration. If aVersion is null there is no declaration. * aStandalone takes values -1, 0 and 1 indicating respectively that there @@ -1530,7 +1526,7 @@ class nsIDocument : public nsINode void SetDisplayDocument(nsIDocument* aDisplayDocument) { NS_PRECONDITION(!GetShell() && - !GetContainer() && + !nsCOMPtr(GetContainer()) && !GetWindow(), "Shouldn't set mDisplayDocument on documents that already " "have a presentation or a docshell or a window"); @@ -1700,7 +1696,7 @@ class nsIDocument : public nsINode * @param aCloneContainer The container for the clone document. */ virtual already_AddRefed - CreateStaticClone(nsIDocShell* aCloneContainer); + CreateStaticClone(nsISupports* aCloneContainer); /** * If this document is a static clone, this returns the original @@ -2231,7 +2227,7 @@ class nsIDocument : public nsINode nsWeakPtr mDocumentLoadGroup; - mozilla::WeakPtr mDocumentContainer; + nsWeakPtr mDocumentContainer; nsCString mCharacterSet; int32_t mCharacterSetSource; diff --git a/content/base/src/moz.build b/content/base/src/moz.build index a882fb892e396..8b46268ee07d9 100644 --- a/content/base/src/moz.build +++ b/content/base/src/moz.build @@ -193,7 +193,6 @@ LOCAL_INCLUDES += [ '/content/xslt/src/xpath', '/content/xul/content/src', '/content/xul/document/src', - '/docshell/base', '/dom/base', '/dom/ipc', '/dom/workers', diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index f7a7a33a6be77..787a1d5fd2c75 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -2622,7 +2622,10 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsISupports* aContext, uint32_t appType = nsIDocShell::APP_TYPE_UNKNOWN; { - nsCOMPtr docShellTreeItem = aLoadingDocument->GetDocShell(); + nsCOMPtr container = aLoadingDocument->GetContainer(); + nsCOMPtr docShellTreeItem = + do_QueryInterface(container); + if (docShellTreeItem) { nsCOMPtr root; docShellTreeItem->GetRootTreeItem(getter_AddRefs(root)); @@ -3150,7 +3153,8 @@ nsContentUtils::IsChromeDoc(nsIDocument *aDocument) bool nsContentUtils::IsChildOfSameType(nsIDocument* aDoc) { - nsCOMPtr docShellAsItem(aDoc->GetDocShell()); + nsCOMPtr container = aDoc->GetContainer(); + nsCOMPtr docShellAsItem(do_QueryInterface(container)); nsCOMPtr sameTypeParent; if (docShellAsItem) { docShellAsItem->GetSameTypeParent(getter_AddRefs(sameTypeParent)); @@ -3231,7 +3235,8 @@ nsContentUtils::IsInChromeDocshell(nsIDocument *aDocument) return IsInChromeDocshell(aDocument->GetDisplayDocument()); } - nsCOMPtr docShell(aDocument->GetDocShell()); + nsCOMPtr docContainer = aDocument->GetContainer(); + nsCOMPtr docShell(do_QueryInterface(docContainer)); int32_t itemType = nsIDocShellTreeItem::typeContent; if (docShell) { docShell->GetItemType(&itemType); @@ -4971,7 +4976,8 @@ nsContentUtils::HidePopupsInDocument(nsIDocument* aDocument) #ifdef MOZ_XUL nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm && aDocument) { - nsCOMPtr docShellToHide = aDocument->GetDocShell(); + nsCOMPtr container = aDocument->GetContainer(); + nsCOMPtr docShellToHide = do_QueryInterface(container); if (docShellToHide) pm->HidePopupsInDocShell(docShellToHide); } @@ -5871,7 +5877,8 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent) return false; } - nsCOMPtr docShell = subDoc->GetDocShell(); + nsCOMPtr container = subDoc->GetContainer(); + nsCOMPtr docShell = do_QueryInterface(container); if (!docShell) { return false; } @@ -5981,7 +5988,8 @@ nsContentUtils::FindPresShellForDocument(const nsIDocument* aDoc) return shell; } - nsCOMPtr docShellTreeItem = doc->GetDocShell(); + nsCOMPtr container = doc->GetContainer(); + nsCOMPtr docShellTreeItem = do_QueryInterface(container); while (docShellTreeItem) { // We may be in a display:none subdocument, or we may not have a presshell // created yet. diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 31337428e9956..6b5feb2e73ff5 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -33,7 +33,7 @@ #include "nsIBaseWindow.h" #include "mozilla/css/Loader.h" #include "mozilla/css/ImageLoader.h" -#include "nsDocShell.h" +#include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" #include "nsCOMArray.h" #include "nsDOMClassInfo.h" @@ -2203,7 +2203,7 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup, nsIScriptSecurityManager *securityManager = nsContentUtils::GetSecurityManager(); if (securityManager) { - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell = do_QueryReferent(mDocumentContainer); if (!docShell && aLoadGroup) { nsCOMPtr cbs; @@ -2699,7 +2699,7 @@ nsDocument::InitCSP(nsIChannel* aChannel) } // ----- Enforce frame-ancestor policy on any applied policies - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell = do_QueryReferent(mDocumentContainer); if (docShell) { bool safeAncestry = false; @@ -2930,7 +2930,7 @@ nsresult nsDocument::GetAllowPlugins(bool * aAllowPlugins) { // First, we ask our docshell if it allows plugins. - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell = do_QueryReferent(mDocumentContainer); if (docShell) { docShell->GetAllowPlugins(aAllowPlugins); @@ -3398,7 +3398,7 @@ nsDocument::SetHeaderData(nsIAtom* aHeaderField, const nsAString& aData) if (aHeaderField == nsGkAtoms::refresh) { // We get into this code before we have a script global yet, so get to // our container via mDocumentContainer. - nsCOMPtr refresher(mDocumentContainer); + nsCOMPtr refresher = do_QueryReferent(mDocumentContainer); if (refresher) { // Note: using mDocumentURI instead of mBaseURI here, for consistency // (used to just use the current URI of our webnavigation, but that @@ -3479,7 +3479,7 @@ nsDocument::doCreateShell(nsPresContext* aContext, mPresShell = shell; // Make sure to never paint if we belong to an invisible DocShell. - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell = do_QueryReferent(mDocumentContainer); if (docShell && docShell->IsInvisible()) shell->SetNeverPainting(true); @@ -4192,41 +4192,29 @@ NotifyActivityChanged(nsIContent *aContent, void *aUnused) } void -nsIDocument::SetContainer(nsDocShell* aContainer) +nsIDocument::SetContainer(nsISupports* aContainer) { - if (aContainer) { - mDocumentContainer = aContainer->asWeakPtr(); - } else { - mDocumentContainer = WeakPtr(); - } - + mDocumentContainer = do_GetWeakReference(aContainer); EnumerateFreezableElements(NotifyActivityChanged, nullptr); - if (!aContainer) { - return; - } - // Get the Docshell - int32_t itemType; - aContainer->GetItemType(&itemType); - // check itemtype - if (itemType == nsIDocShellTreeItem::typeContent) { - // check if same type root - nsCOMPtr sameTypeRoot; - aContainer->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); - NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!"); - - if (sameTypeRoot == aContainer) { - static_cast(this)->SetIsTopLevelContentDocument(true); + nsCOMPtr docShell = do_QueryInterface(aContainer); + if (docShell) { + int32_t itemType; + docShell->GetItemType(&itemType); + // check itemtype + if (itemType == nsIDocShellTreeItem::typeContent) { + // check if same type root + nsCOMPtr sameTypeRoot; + docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); + NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!"); + + if (sameTypeRoot == docShell) { + static_cast(this)->SetIsTopLevelContentDocument(true); + } } } } -nsISupports* -nsIDocument::GetContainer() const -{ - return static_cast(mDocumentContainer); -} - void nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject) { @@ -4284,7 +4272,7 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject) #endif if (mAllowDNSPrefetch) { - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell = do_QueryReferent(mDocumentContainer); if (docShell) { #ifdef DEBUG nsCOMPtr webNav = @@ -4383,7 +4371,8 @@ nsDocument::GetWindowInternal() const // the docshell, the outer window might be still obtainable from the it. nsCOMPtr win; if (mRemovedFromDocShell) { - nsCOMPtr requestor(mDocumentContainer); + nsCOMPtr requestor = + do_QueryReferent(mDocumentContainer); if (requestor) { // The docshell returns the outer window we are done. win = do_GetInterface(requestor); @@ -7810,7 +7799,7 @@ nsDocument::GetLayoutHistoryState() const if (!mScriptGlobalObject) { state = mLayoutHistoryState; } else { - nsCOMPtr docShell(mDocumentContainer); + nsCOMPtr docShell(do_QueryReferent(mDocumentContainer)); if (docShell) { docShell->GetLayoutHistoryState(getter_AddRefs(state)); } @@ -8331,7 +8320,7 @@ nsDocument::CloneDocHelper(nsDocument* clone) const // |mDocumentContainer| is the container of the document that is being // created and not the original container. See CreateStaticClone function(). - nsCOMPtr docLoader(mDocumentContainer); + nsCOMPtr docLoader = do_QueryReferent(mDocumentContainer); if (docLoader) { docLoader->GetLoadGroup(getter_AddRefs(loadGroup)); } @@ -8344,7 +8333,8 @@ nsDocument::CloneDocHelper(nsDocument* clone) const clone->ResetToURI(uri, loadGroup, NodePrincipal()); } } - clone->SetContainer(mDocumentContainer); + nsCOMPtr container = GetContainer(); + clone->SetContainer(container); } // Set scripting object @@ -8855,18 +8845,18 @@ nsIDocument::FlushPendingLinkUpdates() } already_AddRefed -nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer) +nsIDocument::CreateStaticClone(nsISupports* aCloneContainer) { nsCOMPtr domDoc = do_QueryInterface(this); NS_ENSURE_TRUE(domDoc, nullptr); mCreatingStaticClone = true; // Make document use different container during cloning. - nsRefPtr originalShell = mDocumentContainer.get(); - SetContainer(static_cast(aCloneContainer)); + nsCOMPtr originalContainer = GetContainer(); + SetContainer(aCloneContainer); nsCOMPtr clonedNode; nsresult rv = domDoc->CloneNode(true, 1, getter_AddRefs(clonedNode)); - SetContainer(originalShell); + SetContainer(originalContainer); nsCOMPtr clonedDoc; if (NS_SUCCEEDED(rv)) { @@ -10172,7 +10162,8 @@ nsDocument::FullScreenStackTop() static bool IsInActiveTab(nsIDocument* aDoc) { - nsCOMPtr docshell = aDoc->GetDocShell(); + nsCOMPtr container = aDoc->GetContainer(); + nsCOMPtr docshell = do_QueryInterface(container); if (!docshell) { return false; } @@ -10183,8 +10174,12 @@ IsInActiveTab(nsIDocument* aDoc) return false; } + nsCOMPtr dsti = do_QueryInterface(container); + if (!dsti) { + return false; + } nsCOMPtr rootItem; - docshell->GetRootTreeItem(getter_AddRefs(rootItem)); + dsti->GetRootTreeItem(getter_AddRefs(rootItem)); if (!rootItem) { return false; } @@ -10529,7 +10524,7 @@ nsDocument::IsFullScreenEnabled(bool aCallerIsChrome, bool aLogFailure) // Ensure that all ancestor