Bug 1455676 part 11. Remove use of nsIDOMNode from xpfe/. r=qdot

This commit is contained in:
Boris Zbarsky 2018-05-29 22:58:49 -04:00
Родитель 931b9e37ad
Коммит 5fa76e716f
4 изменённых файлов: 6 добавлений и 17 удалений

Просмотреть файл

@ -23,28 +23,22 @@ using mozilla::dom::Element;
// static helper functions
//
static nsCOMPtr<nsIDOMNode> GetDOMNodeFromDocShell(nsIDocShell *aShell);
static void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute,
nsAString &outValue);
static void GetWindowType(nsIXULWindow* inWindow, nsString &outType);
nsCOMPtr<nsIDOMNode> GetDOMNodeFromDocShell(nsIDocShell *aShell)
static Element* GetElementFromDocShell(nsIDocShell *aShell)
{
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIContentViewer> cv;
aShell->GetContentViewer(getter_AddRefs(cv));
if (cv) {
nsCOMPtr<nsIDocument> doc = cv->GetDocument();
if (doc) {
Element* element = doc->GetDocumentElement();
if (element) {
node = element->AsDOMNode();
}
return doc->GetDocumentElement();
}
}
return node;
return nullptr;
}
// generic "retrieve the value of a XUL attribute" function
@ -53,10 +47,8 @@ void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute,
{
nsCOMPtr<nsIDocShell> shell;
if (inWindow && NS_SUCCEEDED(inWindow->GetDocShell(getter_AddRefs(shell)))) {
nsCOMPtr<nsIDOMNode> node(GetDOMNodeFromDocShell(shell));
if (node) {
nsCOMPtr<Element> webshellElement(do_QueryInterface(node));
if (webshellElement)
RefPtr<Element> webshellElement = GetElementFromDocShell(shell);
if (webshellElement) {
webshellElement->GetAttribute(inAttribute, outValue);
}
}

Просмотреть файл

@ -22,7 +22,6 @@
#include "nsIWidget.h"
#include "nsIWindowMediator.h"
#include "nsIDOMChromeWindow.h"
#include "nsIDOMNode.h"
#include "nsIXULBrowserWindow.h"
#include "mozilla/dom/Element.h"

Просмотреть файл

@ -14,7 +14,6 @@
#include "nsAutoPtr.h"
// Interfaces needed to be included
#include "nsIDOMNode.h"
#include "nsIDOMWindow.h"
#include "nsIDOMChromeWindow.h"
#include "nsIBrowserDOMWindow.h"

Просмотреть файл

@ -41,7 +41,6 @@
#include "nsIWebProgressListener.h"
#include "nsIDocument.h"
#include "nsIDOMNode.h"
#include "nsIDocumentLoaderFactory.h"
#include "nsIObserverService.h"