Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 6c854a7

Browse files
committed
Bug 1438270 - Remove nsIDOMDocumentXBL. r=bz
MozReview-Commit-ID: 4TsjUaEdDP2 --HG-- extra : rebase_source : ab61d1832113a8c7b126b8856de59056fcf5ec5e
1 parent 0c0511a commit 6c854a7

12 files changed

Lines changed: 6 additions & 139 deletions

File tree

browser/installer/package-manifest.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
@RESPATH@/components/dom_webspeechrecognition.xpt
222222
#endif
223223
@RESPATH@/components/dom_workers.xpt
224-
@RESPATH@/components/dom_xbl.xpt
225224
@RESPATH@/components/dom_xhr.xpt
226225
@RESPATH@/components/dom_xul.xpt
227226
@RESPATH@/components/dom_presentation.xpt

dom/base/nsDocument.cpp

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959

6060
#include "mozilla/dom/Attr.h"
6161
#include "mozilla/dom/BindingDeclarations.h"
62-
#include "nsIDOMDocumentXBL.h"
6362
#include "mozilla/dom/Element.h"
6463
#include "mozilla/dom/FramingChecker.h"
6564
#include "nsGenericHTMLElement.h"
@@ -1802,7 +1801,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
18021801
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
18031802
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument)
18041803
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode)
1805-
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
18061804
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
18071805
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
18081806
NS_INTERFACE_TABLE_ENTRY(nsDocument, mozilla::dom::EventTarget)
@@ -6214,55 +6212,18 @@ nsIDocument::ImportNode(nsINode& aNode, bool aDeep, ErrorResult& rv) const
62146212
return nullptr;
62156213
}
62166214

6217-
NS_IMETHODIMP
6218-
nsDocument::LoadBindingDocument(const nsAString& aURI)
6219-
{
6220-
ErrorResult rv;
6221-
nsIDocument::LoadBindingDocument(aURI,
6222-
nsContentUtils::GetCurrentJSContext()
6223-
? Some(nsContentUtils::SubjectPrincipal())
6224-
: Nothing(),
6225-
rv);
6226-
return rv.StealNSResult();
6227-
}
6228-
62296215
void
62306216
nsIDocument::LoadBindingDocument(const nsAString& aURI,
62316217
nsIPrincipal& aSubjectPrincipal,
62326218
ErrorResult& rv)
6233-
{
6234-
LoadBindingDocument(aURI, Some(&aSubjectPrincipal), rv);
6235-
}
6236-
6237-
void
6238-
nsIDocument::LoadBindingDocument(const nsAString& aURI,
6239-
const Maybe<nsIPrincipal*>& aSubjectPrincipal,
6240-
ErrorResult& rv)
62416219
{
62426220
nsCOMPtr<nsIURI> uri;
62436221
rv = NS_NewURI(getter_AddRefs(uri), aURI, mCharacterSet, GetDocBaseURI());
62446222
if (rv.Failed()) {
62456223
return;
62466224
}
62476225

6248-
// Note - This computation of subjectPrincipal isn't necessarily sensical.
6249-
// It's just designed to preserve the old semantics during a mass-conversion
6250-
// patch.
6251-
nsCOMPtr<nsIPrincipal> subjectPrincipal =
6252-
aSubjectPrincipal.isSome() ? aSubjectPrincipal.value() : NodePrincipal();
6253-
BindingManager()->LoadBindingDocument(this, uri, subjectPrincipal);
6254-
}
6255-
6256-
NS_IMETHODIMP
6257-
nsDocument::GetBindingParent(nsIDOMNode* aNode, nsIDOMElement** aResult)
6258-
{
6259-
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
6260-
NS_ENSURE_ARG_POINTER(node);
6261-
6262-
Element* bindingParent = nsIDocument::GetBindingParent(*node);
6263-
nsCOMPtr<nsIDOMElement> retval = do_QueryInterface(bindingParent);
6264-
retval.forget(aResult);
6265-
return NS_OK;
6226+
BindingManager()->LoadBindingDocument(this, uri, &aSubjectPrincipal);
62666227
}
62676228

62686229
Element*
@@ -6333,23 +6294,6 @@ nsDocument::GetAnonymousElementByAttribute(nsIContent* aElement,
63336294
return nullptr;
63346295
}
63356296

6336-
NS_IMETHODIMP
6337-
nsDocument::GetAnonymousElementByAttribute(nsIDOMElement* aElement,
6338-
const nsAString& aAttrName,
6339-
const nsAString& aAttrValue,
6340-
nsIDOMElement** aResult)
6341-
{
6342-
nsCOMPtr<Element> element = do_QueryInterface(aElement);
6343-
NS_ENSURE_ARG_POINTER(element);
6344-
6345-
Element* anonEl =
6346-
nsIDocument::GetAnonymousElementByAttribute(*element, aAttrName,
6347-
aAttrValue);
6348-
nsCOMPtr<nsIDOMElement> retval = do_QueryInterface(anonEl);
6349-
retval.forget(aResult);
6350-
return NS_OK;
6351-
}
6352-
63536297
Element*
63546298
nsIDocument::GetAnonymousElementByAttribute(Element& aElement,
63556299
const nsAString& aAttrName,
@@ -6360,17 +6304,6 @@ nsIDocument::GetAnonymousElementByAttribute(Element& aElement,
63606304
return GetAnonymousElementByAttribute(&aElement, attribute, aAttrValue);
63616305
}
63626306

6363-
6364-
NS_IMETHODIMP
6365-
nsDocument::GetAnonymousNodes(nsIDOMElement* aElement,
6366-
nsIDOMNodeList** aResult)
6367-
{
6368-
*aResult = nullptr;
6369-
6370-
nsCOMPtr<nsIContent> content(do_QueryInterface(aElement));
6371-
return BindingManager()->GetAnonymousNodesFor(content, aResult);
6372-
}
6373-
63746307
nsINodeList*
63756308
nsIDocument::GetAnonymousNodes(Element& aElement)
63766309
{

dom/base/nsDocument.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "nsTArray.h"
2222
#include "nsIdentifierMapEntry.h"
2323
#include "nsIDOMDocument.h"
24-
#include "nsIDOMDocumentXBL.h"
2524
#include "nsStubDocumentObserver.h"
2625
#include "nsIScriptGlobalObject.h"
2726
#include "nsIContent.h"
@@ -322,7 +321,6 @@ class PrincipalFlashClassifier;
322321
// Base class for our document implementations.
323322
class nsDocument : public nsIDocument,
324323
public nsIDOMDocument,
325-
public nsIDOMDocumentXBL,
326324
public nsSupportsWeakReference,
327325
public nsIScriptObjectPrincipal,
328326
public nsIRadioGroupContainer,
@@ -636,9 +634,6 @@ class nsDocument : public nsIDocument,
636634
// nsIDOMDocument
637635
NS_DECL_NSIDOMDOCUMENT
638636

639-
// nsIDOMDocumentXBL
640-
NS_DECL_NSIDOMDOCUMENTXBL
641-
642637
using mozilla::dom::DocumentOrShadowRoot::GetElementById;
643638
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagName;
644639
using mozilla::dom::DocumentOrShadowRoot::GetElementsByTagNameNS;

dom/base/nsIDocument.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,9 +2091,6 @@ class nsIDocument : public nsINode,
20912091
return mHaveFiredTitleChange;
20922092
}
20932093

2094-
/**
2095-
* See GetAnonymousElementByAttribute on nsIDOMDocumentXBL.
2096-
*/
20972094
virtual Element*
20982095
GetAnonymousElementByAttribute(nsIContent* aElement,
20992096
nsAtom* aAttrName,
@@ -2985,9 +2982,6 @@ class nsIDocument : public nsINode,
29852982
void LoadBindingDocument(const nsAString& aURI,
29862983
nsIPrincipal& aSubjectPrincipal,
29872984
mozilla::ErrorResult& rv);
2988-
void LoadBindingDocument(const nsAString& aURI,
2989-
const mozilla::Maybe<nsIPrincipal*>& aSubjectPrincipal,
2990-
mozilla::ErrorResult& rv);
29912985
mozilla::dom::XPathExpression*
29922986
CreateExpression(const nsAString& aExpression,
29932987
mozilla::dom::XPathNSResolver* aResolver,

dom/interfaces/xbl/moz.build

Lines changed: 0 additions & 15 deletions
This file was deleted.

dom/interfaces/xbl/nsIDOMDocumentXBL.idl

Lines changed: 0 additions & 21 deletions
This file was deleted.

dom/moz.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ interfaces = [
2121
'events',
2222
'sidebar',
2323
'range',
24-
'xbl',
2524
'xul',
2625
'security',
2726
'storage',

dom/webidl/Document.webidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ partial interface Document {
323323

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

dom/xml/nsXMLPrettyPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "nsXMLPrettyPrinter.h"
77
#include "nsContentUtils.h"
88
#include "nsICSSDeclaration.h"
9-
#include "nsIDOMDocumentXBL.h"
109
#include "nsIObserver.h"
1110
#include "nsSyncLoadService.h"
1211
#include "nsPIDOMWindow.h"

dom/xul/nsXULPopupListener.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@
1212
#include "nsCOMPtr.h"
1313
#include "nsGkAtoms.h"
1414
#include "nsIDOMElement.h"
15-
#include "nsIDOMXULElement.h"
16-
#include "nsIDOMNodeList.h"
17-
#include "nsIDOMDocument.h"
18-
#include "nsIDOMDocumentXBL.h"
1915
#include "nsContentCID.h"
2016
#include "nsContentUtils.h"
2117
#include "nsXULPopupManager.h"
2218
#include "nsIScriptContext.h"
23-
#include "nsIDOMWindow.h"
2419
#include "nsIDocument.h"
2520
#include "nsServiceManagerUtils.h"
2621
#include "nsIPrincipal.h"
@@ -368,18 +363,11 @@ nsXULPopupListener::LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent)
368363
if (identifier.EqualsLiteral("_child")) {
369364
popup = GetImmediateChild(mElement, nsGkAtoms::menupopup);
370365
if (!popup) {
371-
nsCOMPtr<nsIDOMDocumentXBL> nsDoc(do_QueryInterface(document));
372-
nsCOMPtr<nsIDOMNodeList> list;
373-
nsCOMPtr<nsIDOMElement> el = do_QueryInterface(mElement);
374-
nsDoc->GetAnonymousNodes(el, getter_AddRefs(list));
366+
nsINodeList* list = document->GetAnonymousNodes(*mElement);
375367
if (list) {
376-
uint32_t ctr,listLength;
377-
nsCOMPtr<nsIDOMNode> node;
378-
list->GetLength(&listLength);
379-
for (ctr = 0; ctr < listLength; ctr++) {
380-
list->Item(ctr, getter_AddRefs(node));
381-
nsCOMPtr<nsIContent> childContent(do_QueryInterface(node));
382-
368+
uint32_t listLength = list->Length();
369+
for (uint32_t ctr = 0; ctr < listLength; ctr++) {
370+
nsIContent* childContent = list->Item(ctr);
383371
if (childContent->NodeInfo()->Equals(nsGkAtoms::menupopup,
384372
kNameSpaceID_XUL)) {
385373
popup = childContent->AsElement();

0 commit comments

Comments
 (0)