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

Commit 73774a4

Browse files
committed
Bug 1435666 - Part 4: Remove nsIDOMXPathEvaluator. r=bz
MozReview-Commit-ID: 2nZmbJ9mdwI --HG-- extra : rebase_source : 3acc54ac7726de2ff00a9b7ddadfcb7e28f573eb
1 parent 234b89c commit 73774a4

15 files changed

Lines changed: 10 additions & 132 deletions

File tree

browser/installer/package-manifest.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@
223223
@RESPATH@/components/dom_workers.xpt
224224
@RESPATH@/components/dom_xbl.xpt
225225
@RESPATH@/components/dom_xhr.xpt
226-
@RESPATH@/components/dom_xpath.xpt
227226
@RESPATH@/components/dom_xul.xpt
228227
@RESPATH@/components/dom_presentation.xpt
229228
@RESPATH@/components/downloads.xpt

dom/base/nsDocument.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
18111811
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
18121812
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
18131813
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
1814-
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMXPathEvaluator)
18151814
NS_INTERFACE_TABLE_END
18161815
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
18171816
NS_INTERFACE_MAP_END
@@ -1972,7 +1971,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
19721971
#ifdef MOZ_OLD_STYLE
19731972
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleAttrStyleSheet)
19741973
#endif
1975-
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXPathEvaluator)
19761974
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLayoutHistoryState)
19771975
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnloadBlocker)
19781976
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFirstBaseNodeWithHref)
@@ -2065,7 +2063,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
20652063

20662064
tmp->UnlinkOriginalDocumentIfStatic();
20672065

2068-
NS_IMPL_CYCLE_COLLECTION_UNLINK(mXPathEvaluator)
20692066
tmp->mCachedRootElement = nullptr; // Avoid a dangling pointer
20702067
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDisplayDocument)
20712068
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFirstBaseNodeWithHref)
@@ -12161,15 +12158,6 @@ nsIDocument::Evaluate(JSContext* aCx, const nsAString& aExpression,
1216112158
aType, aResult, rv);
1216212159
}
1216312160

12164-
NS_IMETHODIMP
12165-
nsDocument::Evaluate(const nsAString& aExpression, nsIDOMNode* aContextNode,
12166-
nsIDOMNode* aResolver, uint16_t aType,
12167-
nsISupports* aInResult, nsISupports** aResult)
12168-
{
12169-
return XPathEvaluator()->Evaluate(aExpression, aContextNode, aResolver, aType,
12170-
aInResult, aResult);
12171-
}
12172-
1217312161
nsIDocument*
1217412162
nsIDocument::GetTopLevelContentDocument()
1217512163
{
@@ -12513,9 +12501,9 @@ XPathEvaluator*
1251312501
nsIDocument::XPathEvaluator()
1251412502
{
1251512503
if (!mXPathEvaluator) {
12516-
mXPathEvaluator = new dom::XPathEvaluator(this);
12504+
mXPathEvaluator.reset(new dom::XPathEvaluator(this));
1251712505
}
12518-
return mXPathEvaluator;
12506+
return mXPathEvaluator.get();
1251912507
}
1252012508

1252112509
already_AddRefed<nsIDocumentEncoder>

dom/base/nsDocument.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#include "nsDataHashtable.h"
6767
#include "mozilla/TimeStamp.h"
6868
#include "mozilla/Attributes.h"
69-
#include "nsIDOMXPathEvaluator.h"
7069
#include "jsfriendapi.h"
7170
#include "mozilla/LinkedList.h"
7271
#include "CustomElementRegistry.h"
@@ -328,8 +327,7 @@ class nsDocument : public nsIDocument,
328327
public nsIScriptObjectPrincipal,
329328
public nsIRadioGroupContainer,
330329
public nsIApplicationCacheContainer,
331-
public nsStubMutationObserver,
332-
public nsIDOMXPathEvaluator
330+
public nsStubMutationObserver
333331
{
334332
friend class nsIDocument;
335333

@@ -660,8 +658,6 @@ class nsDocument : public nsIDocument,
660658
// nsIApplicationCacheContainer
661659
NS_DECL_NSIAPPLICATIONCACHECONTAINER
662660

663-
NS_DECL_NSIDOMXPATHEVALUATOR
664-
665661
virtual nsresult Init();
666662

667663
virtual already_AddRefed<Element> CreateElem(const nsAString& aName,

dom/base/nsIDocument.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3711,7 +3711,7 @@ class nsIDocument : public nsINode,
37113711

37123712
uint32_t mInSyncOperationCount;
37133713

3714-
RefPtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;
3714+
mozilla::UniquePtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;
37153715

37163716
nsTArray<RefPtr<mozilla::dom::AnonymousContent>> mAnonymousContents;
37173717

dom/base/test/unit/test_range.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function getParsedDocument(aPath) {
177177

178178
function processParsedDocument(doc) {
179179
Assert.ok(doc.documentElement.localName != "parsererror");
180-
Assert.ok(doc instanceof C_i.nsIDOMXPathEvaluator);
181180
Assert.ok(doc instanceof C_i.nsIDOMDocument);
182181

183182
// Clean out whitespace.

dom/interfaces/xpath/moz.build

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

dom/interfaces/xpath/nsIDOMXPathEvaluator.idl

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

dom/moz.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ interfaces = [
2222
'sidebar',
2323
'range',
2424
'xbl',
25-
'xpath',
2625
'xul',
2726
'security',
2827
'storage',

dom/webidl/LegacyQueryInterface.webidl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,3 @@ Window implements LegacyQueryInterface;
9191
XMLHttpRequest implements LegacyQueryInterface;
9292
XMLHttpRequestUpload implements LegacyQueryInterface;
9393
XMLSerializer implements LegacyQueryInterface;
94-
XPathEvaluator implements LegacyQueryInterface;

dom/webidl/XPathEvaluator.webidl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
[Constructor]
88
interface XPathEvaluator {
9-
// Based on nsIDOMXPathEvaluator
109
[NewObject, Throws]
1110
XPathExpression createExpression(DOMString expression,
1211
optional XPathNSResolver? resolver = null);

0 commit comments

Comments
 (0)