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

Unified Diff: sky/engine/core/dom/Node.idl

Issue 924203002: Morph the APIs for Node, ParentNode, and Element closer to the specs (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: less 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 | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/dom/ParentNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Node.idl
diff --git a/sky/engine/core/dom/Node.idl b/sky/engine/core/dom/Node.idl
index e90583dafa8e496784d7687964458feb89a69ee8..8ed0c1472b60364f0b7b0e42c376ba495146a60e 100644
--- a/sky/engine/core/dom/Node.idl
+++ b/sky/engine/core/dom/Node.idl
@@ -1,58 +1,25 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
-[
- DependentLifetime,
-] interface Node : EventTarget {
- readonly attribute Node parentNode;
- readonly attribute Node firstChild;
- readonly attribute Node lastChild;
- readonly attribute Node previousSibling;
- readonly attribute Node nextSibling;
- readonly attribute Document ownerDocument;
+interface Node : EventTarget {
+ // TODO(abarth): This should actually be a named argument.
+ Node cloneNode(optional boolean deep);
- // TODO(esprehn): This should return TreeScope in Sky, but we don't have
- // a TreeScope type yet.
- readonly attribute Node ownerScope;
+ readonly attribute ParentNode owner;
+ readonly attribute ParentNode parentNode;
+ readonly attribute Element parentElement;
- [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node insertBefore(Node newChild, Node? refChild);
- [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node replaceChild(Node newChild, Node oldChild);
- [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node removeChild(Node oldChild);
- [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node appendChild(Node newChild);
+ readonly attribute Node nextSibling;
+ readonly attribute Node previousSibling;
+ readonly attribute Element nextElementSibling;
+ readonly attribute Element previousElementSibling;
- [ImplementedAs=hasChildren] boolean hasChildNodes();
- [CustomElementCallbacks] Node cloneNode(optional boolean deep);
+ [RaisesException, ImplementedAs=newInsertBefore] void insertBefore(sequence<Node> nodes);
+ [RaisesException, ImplementedAs=newInsertAfter] void insertAfter(sequence<Node> nodes);
+ [RaisesException] void replaceWith(sequence<Node> nodes);
- [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString, CustomElementCallbacks] attribute DOMString textContent;
+ [RaisesException] void remove();
- boolean contains(Node other);
-
- // 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);
-
- readonly attribute Element parentElement;
+ [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString textContent;
};
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/dom/ParentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698