Bug 655514 - Remove nsIDOMDocumentTraversal; f=ehsan r=jonas

This commit is contained in:
Ms2ger 2011-05-15 12:07:30 +02:00
parent 72dace0093
commit 2ba2beb025
13 changed files with 35 additions and 36 deletions

View File

@ -57,7 +57,6 @@
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMNodeFilter.h"
@ -3220,16 +3219,15 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
if (accessible)
return accessible;
nsCOMPtr<nsIDOMDocumentTraversal> trav =
do_QueryInterface(aStartNode->GetOwnerDoc());
NS_ENSURE_TRUE(trav, nsnull);
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
NS_ENSURE_TRUE(domDoc, nsnull);
nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(GetNode()));
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
nsCOMPtr<nsIDOMTreeWalker> walker;
trav->CreateTreeWalker(rootNode,
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nsnull, PR_FALSE, getter_AddRefs(walker));
domDoc->CreateTreeWalker(rootNode,
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nsnull, PR_FALSE, getter_AddRefs(walker));
NS_ENSURE_TRUE(walker, nsnull);
walker->SetCurrentNode(currentNode);

View File

@ -55,7 +55,6 @@
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMNSDocument.h"
#include "nsIDOMNSDocumentStyle.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsStubDocumentObserver.h"
#include "nsIDOM3EventTarget.h"
#include "nsIDOMNSEventTarget.h"
@ -497,7 +496,6 @@ class nsDocument : public nsIDocument,
public nsIDOMDocumentEvent,
public nsIDOM3DocumentEvent,
public nsIDOMNSDocumentStyle,
public nsIDOMDocumentTraversal,
public nsIDOMDocumentXBL,
public nsSupportsWeakReference,
public nsIDOMEventTarget,
@ -812,9 +810,6 @@ public:
// nsIDOMNSDocumentStyle
NS_DECL_NSIDOMNSDOCUMENTSTYLE
// nsIDOMDocumentTraversal
NS_DECL_NSIDOMDOCUMENTTRAVERSAL
// nsIDOMDocumentXBL
NS_DECL_NSIDOMDOCUMENTXBL
@ -1258,8 +1253,6 @@ protected:
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \
nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument)

View File

@ -217,7 +217,6 @@ function getRange(aSourceNode, aFragment) {
function getParsedDocument(aPath) {
var doc = do_parse_document(aPath, "application/xml");
do_check_true(doc.documentElement.localName != "parsererror");
do_check_true(doc instanceof C_i.nsIDOMDocumentTraversal);
do_check_true(doc instanceof C_i.nsIDOMXPathEvaluator);
do_check_true(doc instanceof C_i.nsIDOMDocument);

View File

@ -248,7 +248,6 @@
#include "nsIDOMAnimationEvent.h"
#endif
#include "nsIDOMNSDocumentStyle.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMLinkStyle.h"
@ -2305,7 +2304,6 @@ nsDOMClassInfo::RegisterExternalClasses()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentTraversal) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) \

View File

@ -22,6 +22,8 @@
* Contributor(s):
* Vidur Apparao <vidur@netscape.com> (original author)
* Johnny Stenback <jst@netscape.com>
* Jonas Sicking <sicking@bigfoot.com>
* Ms2ger <ms2ger@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -39,6 +41,10 @@
#include "nsIDOMNode.idl"
interface nsIDOMNodeIterator;
interface nsIDOMNodeFilter;
interface nsIDOMTreeWalker;
/**
* The nsIDOMDocument interface represents the entire HTML or XML document.
* Conceptually, it is the root of the document tree, and provides the
@ -52,7 +58,7 @@
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(d93d3452-f937-42c2-89e1-4cc91cc778e5)]
[scriptable, uuid(e286fcde-873d-4902-874b-49255737ee7d)]
interface nsIDOMDocument : nsIDOMNode
{
readonly attribute nsIDOMDocumentType doctype;
@ -122,4 +128,15 @@ interface nsIDOMDocument : nsIDOMNode
* @see http://html5.org/specs/dom-range.html#dom-document-createrange
*/
nsIDOMRange createRange();
nsIDOMNodeIterator createNodeIterator(in nsIDOMNode root,
in unsigned long whatToShow,
in nsIDOMNodeFilter filter,
in boolean entityReferenceExpansion)
raises(DOMException);
nsIDOMTreeWalker createTreeWalker(in nsIDOMNode root,
in unsigned long whatToShow,
in nsIDOMNodeFilter filter,
in boolean entityReferenceExpansion)
raises(DOMException);
};

View File

@ -38,7 +38,7 @@
#include "nsIDOMDocument.idl"
[scriptable, uuid(be5f8278-c9ac-4002-b886-3a148000fb2c)]
[scriptable, uuid(305a78cc-da33-402c-bcd5-44eb993ab391)]
interface nsIDOMXMLDocument : nsIDOMDocument
{
// DOM Level 3 Load & Save, DocumentLS

View File

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(b43a883f-67a6-4c15-9820-faf3b57e3134)]
[scriptable, uuid(4b21c9f8-68bc-4bce-b452-0f844c532dfc)]
interface nsIDOMHTMLDocument : nsIDOMDocument
{
attribute DOMString title;

View File

@ -39,7 +39,7 @@
interface nsIDOMSVGSVGElement;
[scriptable, uuid(3b03aae5-bebc-45fc-a695-543049344582)]
[scriptable, uuid(32f1cd80-9328-4f55-938a-0734217a7944)]
interface nsIDOMSVGDocument : nsIDOMDocument
/* , nsIDOMDocumentEvent */
{

View File

@ -48,7 +48,6 @@ XPIDL_MODULE = dom_traversal
GRE_MODULE = 1
XPIDLSRCS = \
nsIDOMDocumentTraversal.idl \
nsIDOMNodeFilter.idl \
nsIDOMNodeIterator.idl \
nsIDOMTreeWalker.idl \

View File

@ -103,7 +103,6 @@
// for relativization
#include "nsUnicharUtils.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsIDOMTreeWalker.h"
#include "nsIDOMNodeFilter.h"
#include "nsIDOMNamedNodeMap.h"
@ -949,16 +948,14 @@ nsHTMLEditor::RelativizeURIInFragmentList(const nsCOMArray<nsIDOMNode> &aNodeLis
// determine destination URL
nsCOMPtr<nsIDOMDocument> domDoc;
GetDocument(getter_AddRefs(domDoc));
NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
nsCOMPtr<nsIDocument> destDoc = do_QueryInterface(domDoc);
NS_ENSURE_TRUE(destDoc, NS_ERROR_FAILURE);
nsCOMPtr<nsIURL> destURL = do_QueryInterface(destDoc->GetDocBaseURI());
NS_ENSURE_TRUE(destURL, NS_ERROR_FAILURE);
nsresult rv;
nsCOMPtr<nsIDOMDocumentTraversal> trav = do_QueryInterface(domDoc, &rv);
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
PRInt32 listCount = aNodeList.Count();
PRInt32 j;
for (j = 0; j < listCount; j++)
@ -966,8 +963,10 @@ nsHTMLEditor::RelativizeURIInFragmentList(const nsCOMArray<nsIDOMNode> &aNodeLis
nsIDOMNode* somenode = aNodeList[j];
nsCOMPtr<nsIDOMTreeWalker> walker;
rv = trav->CreateTreeWalker(somenode, nsIDOMNodeFilter::SHOW_ELEMENT,
nsnull, PR_TRUE, getter_AddRefs(walker));
nsresult rv = domDoc->CreateTreeWalker(somenode,
nsIDOMNodeFilter::SHOW_ELEMENT,
nsnull, PR_TRUE,
getter_AddRefs(walker));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMNode> currentNode;

View File

@ -44,7 +44,6 @@
#include "nsIEnumerator.h"
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
#include "nsIFrame.h"

View File

@ -72,7 +72,6 @@
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOMDocumentTraversal.h"
#include "nsIDOMTreeWalker.h"
#include "nsIDOMNode.h"
#include "nsIDOMComment.h"
@ -1644,10 +1643,8 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal(
mDocList.AppendElement(docData);
// Walk the DOM gathering a list of externally referenced URIs in the uri map
nsCOMPtr<nsIDOMDocumentTraversal> trav = do_QueryInterface(docData->mDocument, &rv);
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMTreeWalker> walker;
rv = trav->CreateTreeWalker(docAsNode,
rv = aDocument->CreateTreeWalker(docAsNode,
nsIDOMNodeFilter::SHOW_ELEMENT |
nsIDOMNodeFilter::SHOW_DOCUMENT |
nsIDOMNodeFilter::SHOW_PROCESSING_INSTRUCTION,

View File

@ -110,6 +110,7 @@ members = [
'nsIDOMDocument.documentURI',
'nsIDOMDocument.adoptNode',
'nsIDOMDocument.defaultView',
'nsIDOMDocument.createNodeIterator',
'nsIDOMElement.removeAttributeNS',
'nsIDOMElement.removeAttribute',
'nsIDOMElement.getAttribute',
@ -389,7 +390,6 @@ members = [
# dom/interfaces/threads - None.
# dom/interfaces/traversal
'nsIDOMDocumentTraversal.createNodeIterator',
'nsIDOMNodeIterator.nextNode',
# dom/interfaces/xbl - None.