зеркало из https://github.com/mozilla/gecko-dev.git
bug 939049 - get rid of useless QIs r=smaug
This commit is contained in:
Родитель
c5ae45823c
Коммит
158a12ab72
|
@ -99,22 +99,19 @@ LogDocShellState(nsIDocument* aDocumentNode)
|
|||
printf("docshell busy: ");
|
||||
|
||||
nsAutoCString docShellBusy;
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocShell> 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 {
|
||||
nsCOMPtr<nsIDocShell> 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'");
|
||||
|
||||
printf("[failed]");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -132,8 +129,7 @@ static void
|
|||
LogDocShellTree(nsIDocument* aDocumentNode)
|
||||
{
|
||||
if (aDocumentNode->IsActive()) {
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
|
|
|
@ -200,8 +200,7 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
|||
nsIPresShell* ps = aPresShell;
|
||||
nsIDocument* documentNode = aPresShell->GetDocument();
|
||||
if (documentNode) {
|
||||
nsCOMPtr<nsISupports> container = documentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(documentNode->GetDocShell());
|
||||
if (treeItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
|
|
|
@ -394,17 +394,14 @@ nsCoreUtils::GetDocShellFor(nsINode *aNode)
|
|||
if (!aNode)
|
||||
return nullptr;
|
||||
|
||||
nsCOMPtr<nsISupports> container = aNode->OwnerDoc()->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> docShell = aNode->OwnerDoc()->GetDocShell();
|
||||
return docShell.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
nsCoreUtils::IsRootDocument(nsIDocument *aDocument)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
|
||||
do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
|
||||
NS_ASSERTION(docShellTreeItem, "No document shell for document!");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
|
@ -416,9 +413,7 @@ nsCoreUtils::IsRootDocument(nsIDocument *aDocument)
|
|||
bool
|
||||
nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
|
||||
do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
|
||||
NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");
|
||||
|
||||
int32_t contentType;
|
||||
|
@ -429,8 +424,7 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
|
|||
bool
|
||||
nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
|
|
|
@ -377,10 +377,8 @@ Accessible::AccessKey() const
|
|||
nsIDocument* document = mContent->GetCurrentDoc();
|
||||
if (!document)
|
||||
return KeyBinding();
|
||||
nsCOMPtr<nsISupports> container = document->GetContainer();
|
||||
if (!container)
|
||||
return KeyBinding();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(document->GetDocShell());
|
||||
if (!treeItem)
|
||||
return KeyBinding();
|
||||
|
||||
|
@ -1294,9 +1292,7 @@ Accessible::NativeAttributes()
|
|||
nsCoreUtils::GetRoleContent(doc));
|
||||
|
||||
// Allow ARIA live region markup from outer documents to override
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
|
||||
do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
|
||||
if (!docShellTreeItem)
|
||||
break;
|
||||
|
||||
|
|
|
@ -688,8 +688,7 @@ DocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame)
|
|||
nsresult
|
||||
DocAccessible::AddEventListeners()
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(mDocumentNode->GetDocShell());
|
||||
|
||||
// We want to add a command observer only if the document is content and has
|
||||
// an editor.
|
||||
|
@ -721,8 +720,7 @@ DocAccessible::RemoveEventListeners()
|
|||
if (mDocumentNode) {
|
||||
mDocumentNode->RemoveObserver(this);
|
||||
|
||||
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(mDocumentNode->GetDocShell());
|
||||
NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem.");
|
||||
|
||||
if (docShellTreeItem) {
|
||||
|
@ -1994,8 +1992,7 @@ DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
|
|||
bool
|
||||
DocAccessible::IsLoadEventTarget() const
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem = mDocumentNode->GetDocShell();
|
||||
NS_ASSERTION(treeItem, "No document shell for document!");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
|
|
|
@ -1165,6 +1165,11 @@ public:
|
|||
*/
|
||||
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
|
||||
|
@ -1525,7 +1530,7 @@ public:
|
|||
void SetDisplayDocument(nsIDocument* aDisplayDocument)
|
||||
{
|
||||
NS_PRECONDITION(!GetShell() &&
|
||||
!nsCOMPtr<nsISupports>(GetContainer()) &&
|
||||
!GetContainer() &&
|
||||
!GetWindow(),
|
||||
"Shouldn't set mDisplayDocument on documents that already "
|
||||
"have a presentation or a docshell or a window");
|
||||
|
|
|
@ -2626,10 +2626,7 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsISupports* aContext,
|
|||
uint32_t appType = nsIDocShell::APP_TYPE_UNKNOWN;
|
||||
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aLoadingDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
|
||||
do_QueryInterface(container);
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aLoadingDocument->GetDocShell();
|
||||
if (docShellTreeItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
docShellTreeItem->GetRootTreeItem(getter_AddRefs(root));
|
||||
|
@ -3157,8 +3154,7 @@ nsContentUtils::IsChromeDoc(nsIDocument *aDocument)
|
|||
bool
|
||||
nsContentUtils::IsChildOfSameType(nsIDocument* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(aDoc->GetDocShell());
|
||||
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
|
||||
if (docShellAsItem) {
|
||||
docShellAsItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
|
||||
|
@ -3239,8 +3235,7 @@ nsContentUtils::IsInChromeDocshell(nsIDocument *aDocument)
|
|||
return IsInChromeDocshell(aDocument->GetDisplayDocument());
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> docContainer = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryInterface(docContainer));
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell(aDocument->GetDocShell());
|
||||
int32_t itemType = nsIDocShellTreeItem::typeContent;
|
||||
if (docShell) {
|
||||
docShell->GetItemType(&itemType);
|
||||
|
@ -4980,8 +4975,7 @@ nsContentUtils::HidePopupsInDocument(nsIDocument* aDocument)
|
|||
#ifdef MOZ_XUL
|
||||
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
|
||||
if (pm && aDocument) {
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellToHide = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellToHide = aDocument->GetDocShell();
|
||||
if (docShellToHide)
|
||||
pm->HidePopupsInDocShell(docShellToHide);
|
||||
}
|
||||
|
@ -5881,8 +5875,7 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
|
|||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> container = subDoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> docShell = subDoc->GetDocShell();
|
||||
if (!docShell) {
|
||||
return false;
|
||||
}
|
||||
|
@ -6016,8 +6009,7 @@ nsContentUtils::FindPresShellForDocument(const nsIDocument* aDoc)
|
|||
return shell;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
|
||||
while (docShellTreeItem) {
|
||||
// We may be in a display:none subdocument, or we may not have a presshell
|
||||
// created yet.
|
||||
|
|
|
@ -8869,12 +8869,11 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
|
|||
mCreatingStaticClone = true;
|
||||
|
||||
// Make document use different container during cloning.
|
||||
nsCOMPtr<nsISupports> originalContainer = GetContainer();
|
||||
nsCOMPtr<nsIDocShell> originalShell = do_QueryInterface(originalContainer);
|
||||
nsRefPtr<nsDocShell> originalShell = mDocumentContainer.get();
|
||||
SetContainer(static_cast<nsDocShell*>(aCloneContainer));
|
||||
nsCOMPtr<nsIDOMNode> clonedNode;
|
||||
nsresult rv = domDoc->CloneNode(true, 1, getter_AddRefs(clonedNode));
|
||||
SetContainer(static_cast<nsDocShell*>(originalShell.get()));
|
||||
SetContainer(originalShell);
|
||||
|
||||
nsCOMPtr<nsIDocument> clonedDoc;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -10180,8 +10179,7 @@ nsDocument::FullScreenStackTop()
|
|||
static bool
|
||||
IsInActiveTab(nsIDocument* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docshell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> docshell = aDoc->GetDocShell();
|
||||
if (!docshell) {
|
||||
return false;
|
||||
}
|
||||
|
@ -10192,12 +10190,8 @@ IsInActiveTab(nsIDocument* aDoc)
|
|||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(container);
|
||||
if (!dsti) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootItem;
|
||||
dsti->GetRootTreeItem(getter_AddRefs(rootItem));
|
||||
docshell->GetRootTreeItem(getter_AddRefs(rootItem));
|
||||
if (!rootItem) {
|
||||
return false;
|
||||
}
|
||||
|
@ -10856,7 +10850,7 @@ nsDocument::ShouldLockPointer(Element* aElement, Element* aCurrentLock,
|
|||
|
||||
// Check if the element is in a document with a docshell.
|
||||
nsCOMPtr<nsIDocument> ownerDoc = aElement->OwnerDoc();
|
||||
if (!nsCOMPtr<nsISupports>(ownerDoc->GetContainer())) {
|
||||
if (!ownerDoc->GetContainer()) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsPIDOMWindow> ownerWindow = ownerDoc->GetWindow();
|
||||
|
@ -11427,12 +11421,13 @@ nsIDocument::SetContentTypeInternal(const nsACString& aType)
|
|||
nsILoadContext*
|
||||
nsIDocument::GetLoadContext() const
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = GetContainer();
|
||||
if (container) {
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
|
||||
return loadContext;
|
||||
}
|
||||
return nullptr;
|
||||
return mDocumentContainer;
|
||||
}
|
||||
|
||||
nsIDocShell*
|
||||
nsIDocument::GetDocShell() const
|
||||
{
|
||||
return mDocumentContainer;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1359,8 +1359,7 @@ nsTreeSanitizer::Sanitize(nsIDocument* aDocument)
|
|||
// here that notifies / does not notify or that fires mutation events if
|
||||
// in tree.
|
||||
#ifdef DEBUG
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
NS_PRECONDITION(!container, "The document is in a shell.");
|
||||
NS_PRECONDITION(!aDocument->GetContainer(), "The document is in a shell.");
|
||||
nsRefPtr<mozilla::dom::Element> root = aDocument->GetRootElement();
|
||||
NS_PRECONDITION(root->IsHTML(nsGkAtoms::html), "Not HTML root.");
|
||||
#endif
|
||||
|
|
|
@ -993,9 +993,7 @@ UploadLastDir::FetchDirectoryAndDisplayPicker(nsIDocument* aDoc,
|
|||
nsIURI* docURI = aDoc->GetDocumentURI();
|
||||
NS_PRECONDITION(docURI, "docURI is null");
|
||||
|
||||
nsCOMPtr<nsISupports> container = aDoc->GetContainer();
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
|
||||
|
||||
nsCOMPtr<nsILoadContext> loadContext = aDoc->GetLoadContext();
|
||||
nsCOMPtr<nsIContentPrefCallback2> prefCallback =
|
||||
new UploadLastDir::ContentPrefCallback(aFilePicker, aFpCallback);
|
||||
|
||||
|
@ -1046,8 +1044,7 @@ UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
prefValue->SetAsAString(unicodePath);
|
||||
|
||||
nsCOMPtr<nsISupports> container = aDoc->GetContainer();
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
|
||||
nsCOMPtr<nsILoadContext> loadContext = aDoc->GetLoadContext();
|
||||
return contentPrefService->Set(spec, CPS_PREF_NAME, prefValue, loadContext, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1083,12 +1083,9 @@ nsresult HTMLMediaElement::LoadResource()
|
|||
}
|
||||
|
||||
// Check if media is allowed for the docshell.
|
||||
nsCOMPtr<nsISupports> container = OwnerDoc()->GetContainer();
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
if (docShell && !docShell->GetAllowMedia()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsIDocShell> docShell = OwnerDoc()->GetDocShell();
|
||||
if (docShell && !docShell->GetAllowMedia()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
|
||||
|
|
|
@ -3180,8 +3180,7 @@ XULDocument::DoneWalking()
|
|||
// Before starting layout, check whether we're a toplevel chrome
|
||||
// window. If we are, set our chrome flags now, so that we don't have
|
||||
// to restyle the whole frame tree after StartLayout.
|
||||
nsCOMPtr<nsISupports> container = GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> item = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> item = GetDocShell();
|
||||
if (item) {
|
||||
nsCOMPtr<nsIDocShellTreeOwner> owner;
|
||||
item->GetTreeOwner(getter_AddRefs(owner));
|
||||
|
@ -3189,7 +3188,7 @@ XULDocument::DoneWalking()
|
|||
if (xulWin) {
|
||||
nsCOMPtr<nsIDocShell> xulWinShell;
|
||||
xulWin->GetDocShell(getter_AddRefs(xulWinShell));
|
||||
if (SameCOMIdentity(xulWinShell, container)) {
|
||||
if (SameCOMIdentity(xulWinShell, item)) {
|
||||
// We're the chrome document! Apply our chrome flags now.
|
||||
xulWin->ApplyChromeFlags();
|
||||
}
|
||||
|
|
|
@ -2476,8 +2476,7 @@ TabChild::GetFrom(nsIPresShell* aPresShell)
|
|||
if (!doc) {
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShell> docShell(doc->GetDocShell());
|
||||
return GetFrom(docShell);
|
||||
}
|
||||
|
||||
|
|
|
@ -842,10 +842,7 @@ TabParent::RecvSetStatus(const uint32_t& aType, const nsString& aStatus)
|
|||
{
|
||||
nsCOMPtr<nsIContent> frame = do_QueryInterface(mFrameElement);
|
||||
if (frame) {
|
||||
nsCOMPtr<nsISupports> container = frame->OwnerDoc()->GetContainer();
|
||||
if (!container)
|
||||
return true;
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> docShell = frame->OwnerDoc()->GetDocShell();
|
||||
if (!docShell)
|
||||
return true;
|
||||
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
|
||||
|
|
|
@ -97,8 +97,7 @@ GetLoadContext(nsIEditor* aEditor)
|
|||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
|
||||
NS_ENSURE_TRUE(doc, nullptr);
|
||||
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
|
||||
nsCOMPtr<nsILoadContext> loadContext = doc->GetLoadContext();
|
||||
return loadContext.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -189,8 +189,7 @@ nsEditorHookUtils::GetHookEnumeratorFromDocument(nsIDOMDocument *aDoc,
|
|||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDoc);
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> docShell = doc->GetDocShell();
|
||||
nsCOMPtr<nsIClipboardDragDropHookList> hookObj = do_GetInterface(docShell);
|
||||
NS_ENSURE_TRUE(hookObj, NS_ERROR_FAILURE);
|
||||
|
||||
|
|
|
@ -432,8 +432,7 @@ bool nsPlaintextEditor::IsSafeToInsertData(nsIDOMDocument* aSourceDoc)
|
|||
|
||||
nsCOMPtr<nsIDocument> destdoc = GetDocument();
|
||||
NS_ASSERTION(destdoc, "Where is our destination doc?");
|
||||
nsCOMPtr<nsISupports> container = destdoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShellTreeItem> dsti = destdoc->GetDocShell();
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
if (dsti)
|
||||
dsti->GetRootTreeItem(getter_AddRefs(root));
|
||||
|
|
|
@ -958,9 +958,7 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext)
|
|||
"How did we get a presshell?");
|
||||
|
||||
// We don't have our container set yet at this point
|
||||
nsCOMPtr<nsISupports> ourContainer = mDocument->GetContainer();
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> ourItem = do_QueryInterface(ourContainer);
|
||||
nsCOMPtr<nsIDocShellTreeItem> ourItem = mDocument->GetDocShell();
|
||||
if (ourItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
||||
ourItem->GetSameTypeParent(getter_AddRefs(parentItem));
|
||||
|
|
|
@ -981,8 +981,7 @@ EndSwapDocShellsForDocument(nsIDocument* aDocument, void*)
|
|||
// Our docshell and view trees have been updated for the new hierarchy.
|
||||
// Now also update all nsDeviceContext::mWidget to that of the
|
||||
// container view in the new hierarchy.
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> ds = do_QueryInterface(container);
|
||||
nsCOMPtr<nsIDocShell> ds = aDocument->GetDocShell();
|
||||
if (ds) {
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
ds->GetContentViewer(getter_AddRefs(cv));
|
||||
|
|
|
@ -1335,8 +1335,7 @@ nsPrintEngine::MapContentForPO(nsPrintObject* aPO,
|
|||
nsIDocument* subDoc = doc->GetSubDocumentFor(aContent);
|
||||
|
||||
if (subDoc) {
|
||||
nsCOMPtr<nsISupports> container = subDoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
|
||||
nsCOMPtr<nsIDocShell> docShell(subDoc->GetDocShell());
|
||||
|
||||
if (docShell) {
|
||||
nsPrintObject * po = nullptr;
|
||||
|
|
|
@ -876,15 +876,13 @@ nsUserFontSet::CheckFontLoad(const gfxFontFaceSrc* aFontFaceSrc,
|
|||
}
|
||||
|
||||
*aBypassCache = false;
|
||||
nsCOMPtr<nsISupports> container = ps->GetDocument()->GetContainer();
|
||||
if (container) {
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
if (docShell) {
|
||||
uint32_t loadType;
|
||||
if (NS_SUCCEEDED(docShell->GetLoadType(&loadType))) {
|
||||
if ((loadType >> 16) & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) {
|
||||
*aBypassCache = true;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell = ps->GetDocument()->GetDocShell();
|
||||
if (docShell) {
|
||||
uint32_t loadType;
|
||||
if (NS_SUCCEEDED(docShell->GetLoadType(&loadType))) {
|
||||
if ((loadType >> 16) & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) {
|
||||
*aBypassCache = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -982,11 +980,6 @@ nsUserFontSet::GetPrivateBrowsing()
|
|||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> container = ps->GetDocument()->GetContainer();
|
||||
if (!container) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
|
||||
nsCOMPtr<nsILoadContext> loadContext = ps->GetDocument()->GetLoadContext();
|
||||
return loadContext && loadContext->UsePrivateBrowsing();
|
||||
}
|
||||
|
|
|
@ -80,13 +80,8 @@ NS_IMETHODIMP nsContainerBoxObject::GetDocShell(nsIDocShell** aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> container = sub_doc->GetContainer();
|
||||
|
||||
if (!container) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return CallQueryInterface(container, aResult);
|
||||
NS_IF_ADDREF(*aResult = sub_doc->GetDocShell());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -1061,8 +1061,7 @@ nsXULPopupManager::HidePopupsInList(const nsTArray<nsMenuPopupFrame *> &aFrames,
|
|||
bool
|
||||
nsXULPopupManager::IsChildOfDocShell(nsIDocument* aDoc, nsIDocShellTreeItem* aExpected)
|
||||
{
|
||||
nsCOMPtr<nsISupports> doc = aDoc->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(doc));
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShellItem(aDoc->GetDocShell());
|
||||
while(docShellItem) {
|
||||
if (docShellItem == aExpected)
|
||||
return true;
|
||||
|
|
|
@ -584,9 +584,8 @@ nsFormFillController::GetInPrivateContext(bool *aInPrivateContext)
|
|||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mFocusedInput);
|
||||
element->GetOwnerDocument(getter_AddRefs(inputDoc));
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(inputDoc);
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
|
||||
nsCOMPtr<nsIDocShell> docShell = doc->GetDocShell();
|
||||
nsCOMPtr<nsILoadContext> loadContext = doc->GetLoadContext();
|
||||
*aInPrivateContext = loadContext && loadContext->UsePrivateBrowsing();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче