Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: Source/core/dom/Node.idl

Issue 961653004: Sync the Node interface with the spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.idl
diff --git a/Source/core/dom/Node.idl b/Source/core/dom/Node.idl
index d987b1dca45b22c9d4d29fccddb2e37e86249659..b6ce66767a006d725fc62955440a5d91c51a4fd3 100644
--- a/Source/core/dom/Node.idl
+++ b/Source/core/dom/Node.idl
@@ -18,73 +18,72 @@
* Boston, MA 02110-1301, USA.
*/
+// https://dom.spec.whatwg.org/#interface-node
+
[
DependentLifetime,
] interface Node : EventTarget {
- // NodeType
- const unsigned short ELEMENT_NODE = 1;
- const unsigned short ATTRIBUTE_NODE = 2;
- const unsigned short TEXT_NODE = 3;
- const unsigned short CDATA_SECTION_NODE = 4;
- const unsigned short ENTITY_REFERENCE_NODE = 5; // EntityReference nodes are impossible to create in WebKit.
- const unsigned short ENTITY_NODE = 6;
- const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
- const unsigned short COMMENT_NODE = 8;
- const unsigned short DOCUMENT_NODE = 9;
- const unsigned short DOCUMENT_TYPE_NODE = 10;
- const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
- const unsigned short NOTATION_NODE = 12;
-
+ const unsigned short ELEMENT_NODE = 1;
+ // FIXME: Attr should not inherit from Node. crbug.com/305105
+ const unsigned short ATTRIBUTE_NODE = 2;
+ const unsigned short TEXT_NODE = 3;
+ // FIXME: CDATASection has been removed from the spec. crbug.com/437205
+ const unsigned short CDATA_SECTION_NODE = 4;
+ const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
+ const unsigned short ENTITY_NODE = 6; // historical
+ const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
+ const unsigned short COMMENT_NODE = 8;
+ const unsigned short DOCUMENT_NODE = 9;
+ const unsigned short DOCUMENT_TYPE_NODE = 10;
+ const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
+ const unsigned short NOTATION_NODE = 12; // historical
+ readonly attribute unsigned short nodeType;
readonly attribute DOMString nodeName;
- [CustomElementCallbacks] attribute DOMString? nodeValue;
-
- readonly attribute unsigned short nodeType;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Node parentNode;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute NodeList childNodes;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Node firstChild;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Node lastChild;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Node previousSibling;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Node nextSibling;
- [PerWorldBindings, ExposeJSAccessors] readonly attribute Document ownerDocument;
-
- [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node insertBefore(Node newChild, Node? refChild);
- [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node replaceChild(Node newChild, Node oldChild);
- [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node removeChild(Node oldChild);
- [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node appendChild(Node newChild);
+ [ExposeJSAccessors] readonly attribute DOMString? baseURI;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Document? ownerDocument;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Node? parentNode;
+ [PerWorldBindings] readonly attribute Element? parentElement;
[ImplementedAs=hasChildren] boolean hasChildNodes();
- [CustomElementCallbacks] Node cloneNode(optional boolean deep);
- [CustomElementCallbacks] void normalize();
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute NodeList childNodes;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Node? firstChild;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Node? lastChild;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Node? previousSibling;
+ [PerWorldBindings, ExposeJSAccessors] readonly attribute Node? nextSibling;
- // Introduced in DOM Level 2:
- [MeasureAs=NodeNamespaceURI] readonly attribute DOMString? namespaceURI; // Moved to Element and Attr in DOM4.
- [MeasureAs=NodeLocalName] readonly attribute DOMString? localName; // Moved to Element and Attr in DOM4.
+ [CustomElementCallbacks] attribute DOMString? nodeValue;
+ // FIXME: textContent should not have [TreatUndefinedAs=NullString].
+ [TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString? textContent;
+ [CustomElementCallbacks] void normalize();
- // Introduced in DOM Level 3:
- [ExposeJSAccessors] readonly attribute DOMString? baseURI;
+ // FIXME: The deep argument should have a default value false.
+ [CustomElementCallbacks] Node cloneNode(optional boolean deep);
+ boolean isEqualNode(Node? node);
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString textContent;
+ const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
+ const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
+ const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
+ const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
+ const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+ const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
+ unsigned short compareDocumentPosition(Node other);
+ boolean contains(Node? other);
- [MeasureAs=NodeIsSameNode] boolean isSameNode([Default=Undefined] optional Node other); // Removed in DOM4.
- boolean isEqualNode(Node other);
DOMString? lookupPrefix(DOMString? namespaceURI);
- boolean isDefaultNamespace(DOMString? namespaceURI);
DOMString? lookupNamespaceURI(DOMString? prefix);
+ boolean isDefaultNamespace(DOMString? namespaceURI);
- // DocumentPosition
- const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
- const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
- const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
- const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
- const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
- const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
- unsigned short compareDocumentPosition(Node other);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node insertBefore(Node node, Node? child);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node appendChild(Node node);
+ [CustomElementCallbacks, PerWorldBindings, RaisesException, TypeChecking=Interface] Node replaceChild(Node node, Node child);
+ [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node removeChild(Node child);
- // Introduced in DOM4
- boolean contains(Node other);
+ // FIXME: namespaceURI and localName have been moved to Element and Attr.
+ [MeasureAs=NodeNamespaceURI] readonly attribute DOMString? namespaceURI;
+ [MeasureAs=NodeLocalName] readonly attribute DOMString? localName;
- // IE extensions
- [PerWorldBindings] readonly attribute Element parentElement;
+ // FIXME: isSameNode has been removed from the spec:
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27424
+ [MeasureAs=NodeIsSameNode] boolean isSameNode([Default=Undefined] optional Node other);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698