Bug 1438270 - Remove nsIDOMDocumentXBL. r=bz

MozReview-Commit-ID: 4TsjUaEdDP2

--HG--
extra : rebase_source : ab61d1832113a8c7b126b8856de59056fcf5ec5e
This commit is contained in:
Adrian Wielgosik 2018-02-14 20:10:45 +01:00
Родитель 0c0511ae8e
Коммит 6c854a7275
12 изменённых файлов: 6 добавлений и 139 удалений

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

@ -221,7 +221,6 @@
@RESPATH@/components/dom_webspeechrecognition.xpt @RESPATH@/components/dom_webspeechrecognition.xpt
#endif #endif
@RESPATH@/components/dom_workers.xpt @RESPATH@/components/dom_workers.xpt
@RESPATH@/components/dom_xbl.xpt
@RESPATH@/components/dom_xhr.xpt @RESPATH@/components/dom_xhr.xpt
@RESPATH@/components/dom_xul.xpt @RESPATH@/components/dom_xul.xpt
@RESPATH@/components/dom_presentation.xpt @RESPATH@/components/dom_presentation.xpt

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

@ -59,7 +59,6 @@
#include "mozilla/dom/Attr.h" #include "mozilla/dom/Attr.h"
#include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/BindingDeclarations.h"
#include "nsIDOMDocumentXBL.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/dom/FramingChecker.h" #include "mozilla/dom/FramingChecker.h"
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
@ -1802,7 +1801,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, mozilla::dom::EventTarget) NS_INTERFACE_TABLE_ENTRY(nsDocument, mozilla::dom::EventTarget)
@ -6214,30 +6212,10 @@ nsIDocument::ImportNode(nsINode& aNode, bool aDeep, ErrorResult& rv) const
return nullptr; return nullptr;
} }
NS_IMETHODIMP
nsDocument::LoadBindingDocument(const nsAString& aURI)
{
ErrorResult rv;
nsIDocument::LoadBindingDocument(aURI,
nsContentUtils::GetCurrentJSContext()
? Some(nsContentUtils::SubjectPrincipal())
: Nothing(),
rv);
return rv.StealNSResult();
}
void void
nsIDocument::LoadBindingDocument(const nsAString& aURI, nsIDocument::LoadBindingDocument(const nsAString& aURI,
nsIPrincipal& aSubjectPrincipal, nsIPrincipal& aSubjectPrincipal,
ErrorResult& rv) ErrorResult& rv)
{
LoadBindingDocument(aURI, Some(&aSubjectPrincipal), rv);
}
void
nsIDocument::LoadBindingDocument(const nsAString& aURI,
const Maybe<nsIPrincipal*>& aSubjectPrincipal,
ErrorResult& rv)
{ {
nsCOMPtr<nsIURI> uri; nsCOMPtr<nsIURI> uri;
rv = NS_NewURI(getter_AddRefs(uri), aURI, mCharacterSet, GetDocBaseURI()); rv = NS_NewURI(getter_AddRefs(uri), aURI, mCharacterSet, GetDocBaseURI());
@ -6245,24 +6223,7 @@ nsIDocument::LoadBindingDocument(const nsAString& aURI,
return; return;
} }
// Note - This computation of subjectPrincipal isn't necessarily sensical. BindingManager()->LoadBindingDocument(this, uri, &aSubjectPrincipal);
// It's just designed to preserve the old semantics during a mass-conversion
// patch.
nsCOMPtr<nsIPrincipal> subjectPrincipal =
aSubjectPrincipal.isSome() ? aSubjectPrincipal.value() : NodePrincipal();
BindingManager()->LoadBindingDocument(this, uri, subjectPrincipal);
}
NS_IMETHODIMP
nsDocument::GetBindingParent(nsIDOMNode* aNode, nsIDOMElement** aResult)
{
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
NS_ENSURE_ARG_POINTER(node);
Element* bindingParent = nsIDocument::GetBindingParent(*node);
nsCOMPtr<nsIDOMElement> retval = do_QueryInterface(bindingParent);
retval.forget(aResult);
return NS_OK;
} }
Element* Element*
@ -6333,23 +6294,6 @@ nsDocument::GetAnonymousElementByAttribute(nsIContent* aElement,
return nullptr; return nullptr;
} }
NS_IMETHODIMP
nsDocument::GetAnonymousElementByAttribute(nsIDOMElement* aElement,
const nsAString& aAttrName,
const nsAString& aAttrValue,
nsIDOMElement** aResult)
{
nsCOMPtr<Element> element = do_QueryInterface(aElement);
NS_ENSURE_ARG_POINTER(element);
Element* anonEl =
nsIDocument::GetAnonymousElementByAttribute(*element, aAttrName,
aAttrValue);
nsCOMPtr<nsIDOMElement> retval = do_QueryInterface(anonEl);
retval.forget(aResult);
return NS_OK;
}
Element* Element*
nsIDocument::GetAnonymousElementByAttribute(Element& aElement, nsIDocument::GetAnonymousElementByAttribute(Element& aElement,
const nsAString& aAttrName, const nsAString& aAttrName,
@ -6360,17 +6304,6 @@ nsIDocument::GetAnonymousElementByAttribute(Element& aElement,
return GetAnonymousElementByAttribute(&aElement, attribute, aAttrValue); return GetAnonymousElementByAttribute(&aElement, attribute, aAttrValue);
} }
NS_IMETHODIMP
nsDocument::GetAnonymousNodes(nsIDOMElement* aElement,
nsIDOMNodeList** aResult)
{
*aResult = nullptr;
nsCOMPtr<nsIContent> content(do_QueryInterface(aElement));
return BindingManager()->GetAnonymousNodesFor(content, aResult);
}
nsINodeList* nsINodeList*
nsIDocument::GetAnonymousNodes(Element& aElement) nsIDocument::GetAnonymousNodes(Element& aElement)
{ {

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

@ -21,7 +21,6 @@
#include "nsTArray.h" #include "nsTArray.h"
#include "nsIdentifierMapEntry.h" #include "nsIdentifierMapEntry.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
#include "nsStubDocumentObserver.h" #include "nsStubDocumentObserver.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIContent.h" #include "nsIContent.h"
@ -322,7 +321,6 @@ class PrincipalFlashClassifier;
// Base class for our document implementations. // Base class for our document implementations.
class nsDocument : public nsIDocument, class nsDocument : public nsIDocument,
public nsIDOMDocument, public nsIDOMDocument,
public nsIDOMDocumentXBL,
public nsSupportsWeakReference, public nsSupportsWeakReference,
public nsIScriptObjectPrincipal, public nsIScriptObjectPrincipal,
public nsIRadioGroupContainer, public nsIRadioGroupContainer,
@ -636,9 +634,6 @@ public:
// nsIDOMDocument // nsIDOMDocument
NS_DECL_NSIDOMDOCUMENT NS_DECL_NSIDOMDOCUMENT
// nsIDOMDocumentXBL
NS_DECL_NSIDOMDOCUMENTXBL
using mozilla::dom::DocumentOrShadowRoot::GetElementById; using mozilla::dom::DocumentOrShadowRoot::GetElementById;
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName; using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS; using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;

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

@ -2091,9 +2091,6 @@ public:
return mHaveFiredTitleChange; return mHaveFiredTitleChange;
} }
/**
* See GetAnonymousElementByAttribute on nsIDOMDocumentXBL.
*/
virtual Element* virtual Element*
GetAnonymousElementByAttribute(nsIContent* aElement, GetAnonymousElementByAttribute(nsIContent* aElement,
nsAtom* aAttrName, nsAtom* aAttrName,
@ -2985,9 +2982,6 @@ public:
void LoadBindingDocument(const nsAString& aURI, void LoadBindingDocument(const nsAString& aURI,
nsIPrincipal& aSubjectPrincipal, nsIPrincipal& aSubjectPrincipal,
mozilla::ErrorResult& rv); mozilla::ErrorResult& rv);
void LoadBindingDocument(const nsAString& aURI,
const mozilla::Maybe<nsIPrincipal*>& aSubjectPrincipal,
mozilla::ErrorResult& rv);
mozilla::dom::XPathExpression* mozilla::dom::XPathExpression*
CreateExpression(const nsAString& aExpression, CreateExpression(const nsAString& aExpression,
mozilla::dom::XPathNSResolver* aResolver, mozilla::dom::XPathNSResolver* aResolver,

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

@ -1,15 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Core", "XBL")
XPIDL_SOURCES += [
'nsIDOMDocumentXBL.idl',
]
XPIDL_MODULE = 'dom_xbl'

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

@ -1,21 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "domstubs.idl"
[uuid(af628000-e3fa-40d2-9118-fbaa9f3ec6b9)]
interface nsIDOMDocumentXBL : nsISupports
{
/**
* See the MDC documentation for what these methods do.
*/
nsIDOMNodeList getAnonymousNodes(in nsIDOMElement elt);
nsIDOMElement getAnonymousElementByAttribute(in nsIDOMElement elt,
in DOMString attrName,
in DOMString attrValue);
nsIDOMElement getBindingParent(in nsIDOMNode node);
void loadBindingDocument(in DOMString documentURL);
};

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

@ -21,7 +21,6 @@ interfaces = [
'events', 'events',
'sidebar', 'sidebar',
'range', 'range',
'xbl',
'xul', 'xul',
'security', 'security',
'storage', 'storage',

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

@ -323,7 +323,7 @@ partial interface Document {
// Mozilla extensions of various sorts // Mozilla extensions of various sorts
partial interface Document { partial interface Document {
// nsIDOMDocumentXBL. Wish we could make these [ChromeOnly], but // XBL support. Wish we could make these [ChromeOnly], but
// that would likely break bindings running with the page principal. // that would likely break bindings running with the page principal.
[Func="IsChromeOrXBL"] [Func="IsChromeOrXBL"]
NodeList? getAnonymousNodes(Element elt); NodeList? getAnonymousNodes(Element elt);

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

@ -6,7 +6,6 @@
#include "nsXMLPrettyPrinter.h" #include "nsXMLPrettyPrinter.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsICSSDeclaration.h" #include "nsICSSDeclaration.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsSyncLoadService.h" #include "nsSyncLoadService.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"

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

@ -12,15 +12,10 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMXULElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
#include "nsContentCID.h" #include "nsContentCID.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsXULPopupManager.h" #include "nsXULPopupManager.h"
#include "nsIScriptContext.h" #include "nsIScriptContext.h"
#include "nsIDOMWindow.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsIPrincipal.h" #include "nsIPrincipal.h"
@ -368,18 +363,11 @@ nsXULPopupListener::LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent)
if (identifier.EqualsLiteral("_child")) { if (identifier.EqualsLiteral("_child")) {
popup = GetImmediateChild(mElement, nsGkAtoms::menupopup); popup = GetImmediateChild(mElement, nsGkAtoms::menupopup);
if (!popup) { if (!popup) {
nsCOMPtr<nsIDOMDocumentXBL> nsDoc(do_QueryInterface(document)); nsINodeList* list = document->GetAnonymousNodes(*mElement);
nsCOMPtr<nsIDOMNodeList> list;
nsCOMPtr<nsIDOMElement> el = do_QueryInterface(mElement);
nsDoc->GetAnonymousNodes(el, getter_AddRefs(list));
if (list) { if (list) {
uint32_t ctr,listLength; uint32_t listLength = list->Length();
nsCOMPtr<nsIDOMNode> node; for (uint32_t ctr = 0; ctr < listLength; ctr++) {
list->GetLength(&listLength); nsIContent* childContent = list->Item(ctr);
for (ctr = 0; ctr < listLength; ctr++) {
list->Item(ctr, getter_AddRefs(node));
nsCOMPtr<nsIContent> childContent(do_QueryInterface(node));
if (childContent->NodeInfo()->Equals(nsGkAtoms::menupopup, if (childContent->NodeInfo()->Equals(nsGkAtoms::menupopup,
kNameSpaceID_XUL)) { kNameSpaceID_XUL)) {
popup = childContent->AsElement(); popup = childContent->AsElement();

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

@ -145,7 +145,6 @@
#ifdef MOZ_WEBSPEECH #ifdef MOZ_WEBSPEECH
@BINPATH@/components/dom_webspeechrecognition.xpt @BINPATH@/components/dom_webspeechrecognition.xpt
#endif #endif
@BINPATH@/components/dom_xbl.xpt
@BINPATH@/components/dom_xhr.xpt @BINPATH@/components/dom_xhr.xpt
@BINPATH@/components/dom_xul.xpt @BINPATH@/components/dom_xul.xpt
@BINPATH@/components/dom_presentation.xpt @BINPATH@/components/dom_presentation.xpt

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

@ -24,7 +24,6 @@
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentFragment.h" #include "nsIDOMDocumentFragment.h"
#include "nsIDOMDocumentType.h" #include "nsIDOMDocumentType.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMDragEvent.h" #include "nsIDOMDragEvent.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
@ -86,7 +85,6 @@
#include "mozilla/dom/DocumentBinding.h" #include "mozilla/dom/DocumentBinding.h"
#include "mozilla/dom/DocumentFragmentBinding.h" #include "mozilla/dom/DocumentFragmentBinding.h"
#include "mozilla/dom/DocumentTypeBinding.h" #include "mozilla/dom/DocumentTypeBinding.h"
#include "mozilla/dom/DocumentBinding.h"
#include "mozilla/dom/DragEventBinding.h" #include "mozilla/dom/DragEventBinding.h"
#include "mozilla/dom/ElementBinding.h" #include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/EventBinding.h" #include "mozilla/dom/EventBinding.h"
@ -210,7 +208,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM(Document), DEFINE_SHIM(Document),
DEFINE_SHIM(DocumentFragment), DEFINE_SHIM(DocumentFragment),
DEFINE_SHIM(DocumentType), DEFINE_SHIM(DocumentType),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMDocumentXBL, Document),
DEFINE_SHIM(DragEvent), DEFINE_SHIM(DragEvent),
DEFINE_SHIM(Element), DEFINE_SHIM(Element),
DEFINE_SHIM(Event), DEFINE_SHIM(Event),