Bug 611983 - Kill Document.createEntityReference; r=peterv

This commit is contained in:
Ms2ger 2011-05-29 10:33:35 +02:00
parent 4a5030c91a
commit 2b2b9a9fe4
12 changed files with 11 additions and 167 deletions

View File

@ -4532,20 +4532,6 @@ nsDocument::CreateAttributeNS(const nsAString & aNamespaceURI,
return CallQueryInterface(attribute, aResult);
}
NS_IMETHODIMP
nsDocument::CreateEntityReference(const nsAString& aName,
nsIDOMEntityReference** aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
*aReturn = nsnull;
if (IsHTML()) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
}
NS_IMETHODIMP
nsDocument::GetElementsByTagName(const nsAString& aTagname,
nsIDOMNodeList** aReturn)

View File

@ -25,7 +25,6 @@ SimpleTest.waitForExplicitFinish();
var xmlDoc;
function entity(n) { return xmlDoc.createEntityReference(n); }
function text(t) { return document.createTextNode(t); }
function element() { return document.createElement("div"); }
function cdata(t)
@ -233,20 +232,6 @@ function endTests()
is(outer.lastChild, first, "should be no more text at end");
}
function entityTests()
{
todo_isnot(entity("bar"), null,
"need implementation update if we ever support entity nodes!");
var root = xmlDoc.documentElement;
is(root.lastChild.firstChild.nodeType, Node.TEXT_NODE,
"uh-oh, did we start supporting entity references as nodes?");
is(root.lastChild.lastChild.nodeType, Node.ELEMENT_NODE,
"uh-oh, did we start supporting entity references as nodes?");
// If any of the above ever fails, add tests here!
}
function test()
{
try
@ -254,7 +239,6 @@ function test()
startTests();
middleTests();
endTests();
entityTests();
}
catch (e)
{

View File

@ -25,7 +25,6 @@ SimpleTest.waitForExplicitFinish();
var xmlDoc;
function entity(n) { return xmlDoc.createEntityReference(n); }
function text(t) { return document.createTextNode(t); }
function element() { return document.createElement("div"); }
function cdata(t)
@ -207,20 +206,6 @@ function noParentTests()
"orphaned cdatasection should have wholeText == data");
}
function entityTests()
{
todo_isnot(entity("bar"), null,
"need implementation update if we ever support entity nodes!");
var root = xmlDoc.documentElement;
is(root.lastChild.firstChild.nodeType, Node.TEXT_NODE,
"uh-oh, did we start supporting entity references as nodes?");
is(root.lastChild.lastChild.nodeType, Node.ELEMENT_NODE,
"uh-oh, did we start supporting entity references as nodes?");
// If any of the above ever fails, add tests here!
}
function tests()
{
try
@ -229,7 +214,6 @@ function tests()
middleTests();
lastTests();
noParentTests();
entityTests();
}
catch (e)
{

View File

@ -51,8 +51,6 @@ interface nsIDOMDocument;
interface nsIDOMDocumentFragment;
interface nsIDOMDocumentType;
interface nsIDOMElement;
interface nsIDOMEntity;
interface nsIDOMEntityReference;
interface nsIDOMNSElement;
interface nsIDOMNamedNodeMap;
interface nsIDOMNode;

View File

@ -57,8 +57,6 @@ SDK_XPIDLSRCS = \
nsIDOMDocumentFragment.idl \
nsIDOMDocumentType.idl \
nsIDOMElement.idl \
nsIDOMEntity.idl \
nsIDOMEntityReference.idl \
nsIDOMNamedNodeMap.idl \
nsIDOMNode.idl \
nsIDOMNodeList.idl \

View File

@ -62,7 +62,7 @@ interface nsIDOMLocation;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(9b0eb752-21dd-441b-9bd0-674ee3087cb1)]
[scriptable, uuid(d53287e8-3752-4dbc-b7e2-155d39ec09fa)]
interface nsIDOMDocument : nsIDOMNode
{
readonly attribute nsIDOMDocumentType doctype;
@ -80,8 +80,6 @@ interface nsIDOMDocument : nsIDOMNode
raises(DOMException);
nsIDOMAttr createAttribute(in DOMString name)
raises(DOMException);
nsIDOMEntityReference createEntityReference(in DOMString name)
raises(DOMException);
nsIDOMNodeList getElementsByTagName(in DOMString tagname);
// Introduced in DOM Level 2:

View File

@ -1,56 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Vidur Apparao <vidur@netscape.com> (original author)
* Johnny Stenback <jst@netscape.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"),
* 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 "nsIDOMNode.idl"
/**
* The nsIDOMEntity interface represents an entity, either parsed
* or unparsed, in an XML document.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(944d8c6a-631d-408d-846f-d4ff5fa93ae6)]
interface nsIDOMEntity : nsIDOMNode
{
readonly attribute DOMString publicId;
readonly attribute DOMString systemId;
readonly attribute DOMString notationName;
};

View File

@ -1,53 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Vidur Apparao <vidur@netscape.com> (original author)
* Johnny Stenback <jst@netscape.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"),
* 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 "nsIDOMNode.idl"
/**
* nsIDOMEntityReference is an interface to a node that represents a
* reference to one of the entities defined in the document.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(ab7e88aa-7c95-4d0a-94de-c632ca0c25cc)]
interface nsIDOMEntityReference : nsIDOMNode
{
};

View File

@ -38,7 +38,7 @@
#include "nsIDOMDocument.idl"
[scriptable, uuid(86d796ab-fca8-4523-a74c-fa1637f6b1f9)]
[scriptable, uuid(6b26463b-93e3-402a-94f9-28950d512d27)]
interface nsIDOMXMLDocument : nsIDOMDocument
{
// DOM Level 3 Load & Save, DocumentLS

View File

@ -46,7 +46,7 @@
* @see <http://www.whatwg.org/html/>
*/
[scriptable, uuid(aaa9dc9d-ed31-4fe0-82df-e4b4886feee1)]
[scriptable, uuid(ea0fc5de-dfc5-4091-877e-2b48c7e37d8f)]
interface nsIDOMHTMLDocument : nsIDOMDocument
{
readonly attribute DOMString URL;

View File

@ -39,7 +39,7 @@
interface nsIDOMSVGSVGElement;
[scriptable, uuid(4574e99c-0003-4826-8d3d-fbd4befae9fe)]
[scriptable, uuid(1b398f1c-dd2b-4657-9fb9-198817c54b86)]
interface nsIDOMSVGDocument : nsIDOMDocument
{
readonly attribute DOMString domain;

View File

@ -83,8 +83,13 @@ var attributeModTests = ["hc_attrappendchild1", "hc_attrappendchild3", "hc_attra
var modTests = ["hc_elementwrongdocumenterr", "hc_namednodemapwrongdocumenterr", "hc_nodeappendchildnewchilddiffdocument", "hc_nodeinsertbeforenewchilddiffdocument",
"hc_nodereplacechildnewchilddiffdocument", "hc_elementwrongdocumenterr", "hc_namednodemapwrongdocumenterr", "hc_nodeappendchildnewchilddiffdocument",
"hc_nodeinsertbeforenewchilddiffdocument", "hc_nodereplacechildnewchilddiffdocument", "elementwrongdocumenterr", "namednodemapwrongdocumenterr",
"nodeappendchildnewchilddiffdocument", "nodeinsertbeforenewchilddiffdocument", "nodereplacechildnewchilddiffdocument"];
"nodeappendchildnewchilddiffdocument", "nodeinsertbeforenewchilddiffdocument", "nodereplacechildnewchilddiffdocument"];
// These tests rely on an implementation of document.createEntityReference.
var createEntityRef = ["documentinvalidcharacterexceptioncreateentref",
"documentinvalidcharacterexceptioncreateentref1",
"hc_attrgetvalue2", "hc_nodevalue03"];
var todoTests = {};
var exclusions = concat(dtdTests, indexErrTests, attributeModTests, modTests);
var exclusions = concat(dtdTests, indexErrTests, attributeModTests, modTests, createEntityRef);
for (var excludedTestName in exclusions) { todoTests[exclusions[excludedTestName]] = true; }