Bug 639849 - Remove nsIDOM3Document; r=bz

This commit is contained in:
Ms2ger 2011-03-26 17:06:27 +01:00
Родитель 321961bef6
Коммит eb06dc25f9
16 изменённых файлов: 113 добавлений и 141 удалений

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

@ -42,7 +42,7 @@
#include "nsDOMAttributeMap.h"
#include "nsDOMAttribute.h"
#include "nsIDOM3Document.h"
#include "nsIDOMDocument.h"
#include "nsGenericElement.h"
#include "nsIContent.h"
#include "nsIDocument.h"
@ -298,7 +298,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
}
if (!mContent->HasSameOwnerDoc(iAttribute)) {
nsCOMPtr<nsIDOM3Document> domDoc =
nsCOMPtr<nsIDOMDocument> domDoc =
do_QueryInterface(mContent->GetOwnerDoc(), &rv);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -52,7 +52,6 @@
#include "nsTArray.h"
#include "nsHashSets.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOM3Document.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIDOMNSDocument.h"
@ -509,7 +508,6 @@ class nsDocument : public nsIDocument,
public nsIDOMDocumentRange,
public nsIDOMDocumentTraversal,
public nsIDOMDocumentXBL,
public nsIDOM3Document,
public nsSupportsWeakReference,
public nsIDOMEventTarget,
public nsIDOM3EventTarget,
@ -805,9 +803,6 @@ public:
// nsIDOMDocument
NS_DECL_NSIDOMDOCUMENT
// nsIDOM3Document
NS_DECL_NSIDOM3DOCUMENT
// nsIDOMXMLDocument
NS_DECL_NSIDOMXMLDOCUMENT
@ -1279,7 +1274,6 @@ protected:
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \
nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOM3Document, nsDocument)
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument)
#endif /* nsDocument_h___ */

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

@ -3564,7 +3564,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
rv = kid->GetNodeType(&nodeType);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOM3Document> domDoc = do_QueryInterface(GetOwnerDoc());
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(GetOwnerDoc());
// DocumentType nodes are the only nodes that can have a null
// ownerDocument according to the DOM spec, and we need to allow
@ -4075,7 +4075,7 @@ nsINode::ReplaceOrInsertBefore(PRBool aReplace, nsINode* aNewChild,
if (!HasSameOwnerDoc(newContent) &&
(nodeType != nsIDOMNode::DOCUMENT_TYPE_NODE ||
newContent->GetOwnerDoc())) {
nsCOMPtr<nsIDOM3Document> domDoc = do_QueryInterface(doc);
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
if (domDoc) {
nsresult rv;

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

@ -87,7 +87,6 @@
#include "nsCrossSiteListenerProxy.h"
#include "nsDOMError.h"
#include "nsIHTMLDocument.h"
#include "nsIDOM3Document.h"
#include "nsIMultiPartChannel.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIStorageStream.h"
@ -2279,13 +2278,10 @@ GetRequestBody(nsIVariant* aBody, nsIInputStream** aResult,
nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(supports);
if (doc) {
aContentType.AssignLiteral("application/xml");
nsCOMPtr<nsIDOM3Document> dom3doc = do_QueryInterface(doc);
if (dom3doc) {
nsAutoString inputEncoding;
dom3doc->GetInputEncoding(inputEncoding);
if (!DOMStringIsNull(inputEncoding)) {
CopyUTF16toUTF8(inputEncoding, aCharset);
}
nsAutoString inputEncoding;
doc->GetInputEncoding(inputEncoding);
if (!DOMStringIsNull(inputEncoding)) {
CopyUTF16toUTF8(inputEncoding, aCharset);
}
// Serialize to a stream so that the encoding used will

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

@ -1337,7 +1337,12 @@ nsHTMLDocument::GetElementsByTagName(const nsAString& aTagname,
return nsDocument::GetElementsByTagName(aTagname, aReturn);
}
// nsIDOM3Document interface implementation
NS_IMETHODIMP
nsHTMLDocument::GetInputEncoding(nsAString& aInputEncoding)
{
return nsDocument::GetInputEncoding(aInputEncoding);
}
NS_IMETHODIMP
nsHTMLDocument::GetXmlEncoding(nsAString& aXmlEncoding)
{
@ -1351,7 +1356,7 @@ nsHTMLDocument::GetXmlEncoding(nsAString& aXmlEncoding)
}
NS_IMETHODIMP
nsHTMLDocument::GetXmlStandalone(PRBool *aXmlStandalone)
nsHTMLDocument::GetXmlStandalone(PRBool* aXmlStandalone)
{
if (!IsHTML()) {
return nsDocument::GetXmlStandalone(aXmlStandalone);
@ -1372,7 +1377,6 @@ nsHTMLDocument::SetXmlStandalone(PRBool aXmlStandalone)
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
NS_IMETHODIMP
nsHTMLDocument::GetXmlVersion(nsAString& aXmlVersion)
{
@ -1395,6 +1399,57 @@ nsHTMLDocument::SetXmlVersion(const nsAString& aXmlVersion)
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
NS_IMETHODIMP
nsHTMLDocument::GetStrictErrorChecking(PRBool* aStrictErrorChecking)
{
return nsDocument::GetStrictErrorChecking(aStrictErrorChecking);
}
NS_IMETHODIMP
nsHTMLDocument::SetStrictErrorChecking(PRBool aStrictErrorChecking)
{
return nsDocument::SetStrictErrorChecking(aStrictErrorChecking);
}
NS_IMETHODIMP
nsHTMLDocument::GetDocumentURI(nsAString& aDocumentURI)
{
return nsDocument::GetDocumentURI(aDocumentURI);
}
NS_IMETHODIMP
nsHTMLDocument::SetDocumentURI(const nsAString& aDocumentURI)
{
return nsDocument::SetDocumentURI(aDocumentURI);
}
NS_IMETHODIMP
nsHTMLDocument::AdoptNode(nsIDOMNode* aSource, nsIDOMNode** aRetval)
{
return nsDocument::AdoptNode(aSource, aRetval);
}
NS_IMETHODIMP
nsHTMLDocument::GetDomConfig(nsIDOMDOMConfiguration** aDomConfig)
{
return nsDocument::GetDomConfig(aDomConfig);
}
NS_IMETHODIMP
nsHTMLDocument::NormalizeDocument()
{
return nsDocument::NormalizeDocument();
}
NS_IMETHODIMP
nsHTMLDocument::RenameNode(nsIDOMNode* aNode,
const nsAString& aNamespaceURI,
const nsAString& aQualifiedName,
nsIDOMNode** aRetval)
{
return nsDocument::RenameNode(aNode, aNamespaceURI, aQualifiedName, aRetval);
}
//
// nsIDOMHTMLDocument interface implementation
//

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

@ -74,6 +74,8 @@ class nsHTMLDocument : public nsDocument,
public nsIDOMNSHTMLDocument
{
public:
using nsDocument::SetDocumentURI;
nsHTMLDocument();
virtual nsresult Init();
@ -123,13 +125,6 @@ public:
// nsIDOMDocument interface
NS_DECL_NSIDOMDOCUMENT
// nsIDOM3Document interface
NS_IMETHOD GetXmlEncoding(nsAString& aXmlVersion);
NS_IMETHOD GetXmlStandalone(PRBool *aXmlStandalone);
NS_IMETHOD SetXmlStandalone(PRBool aXmlStandalone);
NS_IMETHOD GetXmlVersion(nsAString& aXmlVersion);
NS_IMETHOD SetXmlVersion(const nsAString& aXmlVersion);
// nsIDOMNode interface
NS_FORWARD_NSIDOMNODE(nsDocument::)

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

@ -45,7 +45,9 @@
class nsSVGDocument : public nsXMLDocument,
public nsIDOMSVGDocument
{
public:
public:
using nsDocument::GetElementById;
using nsDocument::SetDocumentURI;
nsSVGDocument();
virtual ~nsSVGDocument();

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

@ -53,7 +53,6 @@
#include "mozilla/dom/Element.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOM3Document.h"
#include "nsIDOMNSDocument.h"
#include "nsIDOMElement.h"
#include "nsIDOMStorageObsolete.h"

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

@ -80,7 +80,6 @@
#include "nsIAttribute.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOM3Document.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOMNSDocument.h"
#include "nsIDOMEvent.h"
@ -2193,7 +2192,6 @@ nsDOMClassInfo::WrapNativeParent(JSContext *cx, JSObject *scope,
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Document) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathEvaluator) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)

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

@ -108,7 +108,6 @@
#include "nsIDOMCrypto.h"
#endif
#include "nsIDOMDocument.h"
#include "nsIDOM3Document.h"
#include "nsIDOMNSDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMElement.h"
@ -7956,9 +7955,7 @@ nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage)
*aSessionStorage = nsnull;
nsString documentURI;
nsCOMPtr<nsIDOM3Document> document3 = do_QueryInterface(mDoc);
if (document3)
document3->GetDocumentURI(documentURI);
mDocument->GetDocumentURI(documentURI);
nsresult rv = docShell->GetSessionStorageForPrincipal(principal,
documentURI,
@ -8042,9 +8039,7 @@ nsGlobalWindow::GetLocalStorage(nsIDOMStorage ** aLocalStorage)
NS_ENSURE_SUCCESS(rv, rv);
nsString documentURI;
nsCOMPtr<nsIDOM3Document> document3 = do_QueryInterface(mDoc);
if (document3)
document3->GetDocumentURI(documentURI);
mDocument->GetDocumentURI(documentURI);
rv = storageManager->GetLocalStorageForPrincipal(principal,
documentURI,

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

@ -67,7 +67,6 @@ SDK_XPIDLSRCS = \
nsIDOMText.idl \
$(NULL)
XPIDLSRCS = \
nsIDOM3Document.idl \
nsIDOM3Node.idl \
nsIDOM3Text.idl \
nsIDOM3TypeInfo.idl \

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

@ -1,75 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org Code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2003
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Christopher A. Aillon <christopher@aillon.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "domstubs.idl"
interface nsIDOMDOMConfiguration;
/**
* For more information on this interface, please see
* http://www.w3.org/TR/DOM-Level-3-Core/
*/
[scriptable, uuid(c0568f22-b9d5-427a-9642-b6a797edc5cd)]
interface nsIDOM3Document : nsISupports
{
// Introduced in DOM Level 3:
readonly attribute DOMString inputEncoding;
// Introduced in DOM Level 3:
readonly attribute DOMString xmlEncoding;
// Introduced in DOM Level 3:
attribute boolean xmlStandalone;
// raises(DOMException) on setting
// Introduced in DOM Level 3:
attribute DOMString xmlVersion;
// raises(DOMException) on setting
// Introduced in DOM Level 3:
attribute boolean strictErrorChecking;
// Introduced in DOM Level 3:
attribute DOMString documentURI;
// Introduced in DOM Level 3:
nsIDOMNode adoptNode(in nsIDOMNode source)
raises(DOMException);
// Introduced in DOM Level 3:
readonly attribute nsIDOMDOMConfiguration domConfig;
// Introduced in DOM Level 3:
void normalizeDocument();
// Introduced in DOM Level 3:
nsIDOMNode renameNode(in nsIDOMNode node,
in DOMString namespaceURI,
in DOMString qualifiedName)
raises(DOMException);
};

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

@ -39,6 +39,8 @@
#include "nsIDOMNode.idl"
interface nsIDOMDOMConfiguration;
/**
* The nsIDOMDocument interface represents the entire HTML or XML document.
* Conceptually, it is the root of the document tree, and provides the
@ -49,10 +51,10 @@
* objects.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Core/
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(a6cf9075-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(fde1a53b-cf60-4997-a0b2-1aa1dc55492e)]
interface nsIDOMDocument : nsIDOMNode
{
readonly attribute nsIDOMDocumentType doctype;
@ -91,4 +93,30 @@ interface nsIDOMDocument : nsIDOMNode
in DOMString localName);
// Introduced in DOM Level 2:
nsIDOMElement getElementById(in DOMString elementId);
// Introduced in DOM Level 3:
readonly attribute DOMString inputEncoding;
// Introduced in DOM Level 3:
readonly attribute DOMString xmlEncoding;
// Introduced in DOM Level 3:
attribute boolean xmlStandalone;
// raises(DOMException) on setting
// Introduced in DOM Level 3:
attribute DOMString xmlVersion;
// raises(DOMException) on setting
// Introduced in DOM Level 3:
attribute boolean strictErrorChecking;
// Introduced in DOM Level 3:
attribute DOMString documentURI;
// Introduced in DOM Level 3:
nsIDOMNode adoptNode(in nsIDOMNode source)
raises(DOMException);
// Introduced in DOM Level 3:
readonly attribute nsIDOMDOMConfiguration domConfig;
// Introduced in DOM Level 3:
void normalizeDocument();
// Introduced in DOM Level 3:
nsIDOMNode renameNode(in nsIDOMNode node,
in DOMString namespaceURI,
in DOMString qualifiedName)
raises(DOMException);
};

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

@ -1,7 +1,6 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 tw=80 et cindent: */
/*
* ***** BEGIN LICENSE BLOCK *****
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -61,7 +60,6 @@
#include "nsIDOMWindow.h"
#include "nsIDOMWindowCollection.h"
#include "nsIWebBrowser.h"
#include "nsIDOM3Document.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIFormControl.h"
@ -555,8 +553,7 @@ EmbedContextMenuInfo::UpdateContextData(nsIDOMEvent *aDOMEvent)
if (NS_SUCCEEDED(rv) && domDoc && mCtxDocument != domDoc) {
mCtxDocument = domDoc;
mNSHHTMLElementSc = nsnull;
nsCOMPtr<nsIDOM3Document> docuri = do_QueryInterface(mCtxDocument);
docuri->GetDocumentURI(mCtxURI);
mCtxDocument->GetDocumentURI(mCtxURI);
NS_ENSURE_ARG_POINTER(mOwner);
nsCOMPtr<nsIWebBrowser> webBrowser;
mOwner->mWindow->GetWebBrowser(getter_AddRefs(webBrowser));

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

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -49,7 +48,6 @@
#include "nsIComponentManager.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOM3Document.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMWindow.h"
#include "nsIDOMElement.h"
@ -1747,10 +1745,7 @@ nsEventStatus nsWebBrowser::HandleEvent(nsGUIEvent *aEvent)
#if defined(DEBUG_smaug)
nsCOMPtr<nsIDOMDocument> domDocument = do_GetInterface(browser->mDocShell);
nsAutoString documentURI;
if (domDocument) {
nsCOMPtr<nsIDOM3Document> d3 = do_QueryInterface(domDocument);
d3->GetDocumentURI(documentURI);
}
domDocument->GetDocumentURI(documentURI);
printf("nsWebBrowser::NS_ACTIVATE %p %s\n", (void*)browser,
NS_ConvertUTF16toUTF8(documentURI).get());
#endif
@ -1762,10 +1757,7 @@ nsEventStatus nsWebBrowser::HandleEvent(nsGUIEvent *aEvent)
#if defined(DEBUG_smaug)
nsCOMPtr<nsIDOMDocument> domDocument = do_GetInterface(browser->mDocShell);
nsAutoString documentURI;
if (domDocument) {
nsCOMPtr<nsIDOM3Document> d3 = do_QueryInterface(domDocument);
d3->GetDocumentURI(documentURI);
}
domDocument->GetDocumentURI(documentURI);
printf("nsWebBrowser::NS_DEACTIVATE %p %s\n", (void*)browser,
NS_ConvertUTF16toUTF8(documentURI).get());
#endif

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

@ -106,6 +106,9 @@ members = [
'nsIDOMDocument.createElementNS',
'nsIDOMDocument.importNode',
'nsIDOMDocument.createTextNode',
'nsIDOMDocument.documentURI',
'nsIDOMDocument.adoptNode',
'nsIDOMDocument.renameNode',
'nsIDOMElement.removeAttributeNS',
'nsIDOMElement.removeAttribute',
'nsIDOMElement.getAttribute',
@ -145,9 +148,6 @@ members = [
'nsIDOMNodeSelector.querySelector',
'nsIDOMNodeSelector.querySelectorAll',
'nsIDOMText.splitText',
'nsIDOM3Document.documentURI',
'nsIDOM3Document.adoptNode',
'nsIDOM3Document.renameNode',
'nsIDOM3Node.*',
'nsIDOMDOMImplementation.*',
'nsIDOMDOMStringList.*',
@ -892,9 +892,6 @@ customMethodCalls = {
'nsIDOMNSDocument_': {
'thisType': 'nsDocument'
},
'nsIDOM3Document_': {
'thisType': 'nsDocument'
},
'nsIDOMElement_': {
'thisType': 'nsGenericElement'
},