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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 // found in the LICENSE file.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20 4
21 [ 5 interface Node : EventTarget {
22 DependentLifetime, 6 // TODO(abarth): This should actually be a named argument.
eseidel 2015/02/14 00:12:23 Can't it be today? [Named] should work?
abarth-chromium 2015/02/14 00:27:19 I wrote it before you landed your change. :) Can
23 ] interface Node : EventTarget { 7 Node cloneNode(optional boolean deep);
24 readonly attribute Node parentNode;
25 readonly attribute Node firstChild;
26 readonly attribute Node lastChild;
27 readonly attribute Node previousSibling;
28 readonly attribute Node nextSibling;
29 readonly attribute Document ownerDocument;
30 8
31 // TODO(esprehn): This should return TreeScope in Sky, but we don't have 9 readonly attribute ParentNode owner;
32 // a TreeScope type yet. 10 readonly attribute ParentNode parentNode;
33 readonly attribute Node ownerScope; 11 readonly attribute Element parentElement;
34 12
35 [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node inser tBefore(Node newChild, Node? refChild); 13 readonly attribute Node nextSibling;
36 [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node repla ceChild(Node newChild, Node oldChild); 14 readonly attribute Node previousSibling;
37 [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node remov eChild(Node oldChild); 15 readonly attribute Element nextElementSibling;
38 [CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node appen dChild(Node newChild); 16 readonly attribute Element previousElementSibling;
39 17
40 [ImplementedAs=hasChildren] boolean hasChildNodes(); 18 [RaisesException, ImplementedAs=newInsertBefore] void insertBefore(sequence<No de> nodes);
41 [CustomElementCallbacks] Node cloneNode(optional boolean deep); 19 [RaisesException, ImplementedAs=newInsertAfter] void insertAfter(sequence<Node > nodes);
20 [RaisesException] void replaceWith(sequence<Node> nodes);
42 21
43 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=Nu llString, CustomElementCallbacks] attribute DOMString textContent; 22 [RaisesException] void remove();
44 23
45 boolean contains(Node other); 24 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString t extContent;
46
47 // DocumentPosition
48 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
49 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
50 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
51 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
52 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
53 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
54
55 unsigned short compareDocumentPosition(Node other);
56
57 readonly attribute Element parentElement;
58 }; 25 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698