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

Side by Side Diff: Source/core/dom/Node.h

Issue 1085843002: Implement DOM: prepend, append, before, after & replaceWith (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to 19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 * 22 *
23 */ 23 */
24 24
25 #ifndef Node_h 25 #ifndef Node_h
26 #define Node_h 26 #define Node_h
27 27
28 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 28 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
29 #include "bindings/core/v8/UnionTypesCore.h"
29 #include "core/CoreExport.h" 30 #include "core/CoreExport.h"
30 #include "core/dom/MutationObserver.h" 31 #include "core/dom/MutationObserver.h"
31 #include "core/dom/SimulatedClickOptions.h" 32 #include "core/dom/SimulatedClickOptions.h"
32 #include "core/dom/StyleChangeReason.h" 33 #include "core/dom/StyleChangeReason.h"
33 #include "core/dom/TreeScope.h" 34 #include "core/dom/TreeScope.h"
34 #include "core/dom/TreeShared.h" 35 #include "core/dom/TreeShared.h"
35 #include "core/editing/EditingBoundary.h" 36 #include "core/editing/EditingBoundary.h"
36 #include "core/events/EventTarget.h" 37 #include "core/events/EventTarget.h"
37 #include "core/inspector/InspectorCounters.h" 38 #include "core/inspector/InspectorCounters.h"
38 #include "core/style/ComputedStyleConstants.h" 39 #include "core/style/ComputedStyleConstants.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 ContainerNode* parentNode() const; 200 ContainerNode* parentNode() const;
200 Element* parentElement() const; 201 Element* parentElement() const;
201 ContainerNode* parentElementOrShadowRoot() const; 202 ContainerNode* parentElementOrShadowRoot() const;
202 ContainerNode* parentElementOrDocumentFragment() const; 203 ContainerNode* parentElementOrDocumentFragment() const;
203 Node* previousSibling() const { return m_previous; } 204 Node* previousSibling() const { return m_previous; }
204 Node* nextSibling() const { return m_next; } 205 Node* nextSibling() const { return m_next; }
205 PassRefPtrWillBeRawPtr<NodeList> childNodes(); 206 PassRefPtrWillBeRawPtr<NodeList> childNodes();
206 Node* firstChild() const; 207 Node* firstChild() const;
207 Node* lastChild() const; 208 Node* lastChild() const;
208 209
210 void prepend(const HeapVector<NodeOrString>&, ExceptionState&);
211 void append(const HeapVector<NodeOrString>&, ExceptionState&);
212 void before(const HeapVector<NodeOrString>&, ExceptionState&);
213 void after(const HeapVector<NodeOrString>&, ExceptionState&);
214 void replaceWith(const HeapVector<NodeOrString>&, ExceptionState&);
209 void remove(ExceptionState&); 215 void remove(ExceptionState&);
216 PassRefPtrWillBeRawPtr<Node> nodeOrStringToNode(const NodeOrString&);
philipj_slow 2015/06/15 10:06:58 Can't these be static in the .cpp file?
Paritosh Kumar 2015/06/23 13:32:09 As I'm using Node::document() method in nodeOrStri
philipj_slow 2015/06/25 11:05:21 Oh, you need the Document to create the Text nodes
217 PassRefPtrWillBeRawPtr<Node> convertNodesIntoNode(const HeapVector<NodeOrStr ing>&);
210 218
211 Node* pseudoAwareNextSibling() const; 219 Node* pseudoAwareNextSibling() const;
212 Node* pseudoAwarePreviousSibling() const; 220 Node* pseudoAwarePreviousSibling() const;
213 Node* pseudoAwareFirstChild() const; 221 Node* pseudoAwareFirstChild() const;
214 Node* pseudoAwareLastChild() const; 222 Node* pseudoAwareLastChild() const;
215 223
216 virtual KURL baseURI() const; 224 virtual KURL baseURI() const;
217 225
218 PassRefPtrWillBeRawPtr<Node> insertBefore(PassRefPtrWillBeRawPtr<Node> newCh ild, Node* refChild, ExceptionState& = ASSERT_NO_EXCEPTION); 226 PassRefPtrWillBeRawPtr<Node> insertBefore(PassRefPtrWillBeRawPtr<Node> newCh ild, Node* refChild, ExceptionState& = ASSERT_NO_EXCEPTION);
219 PassRefPtrWillBeRawPtr<Node> replaceChild(PassRefPtrWillBeRawPtr<Node> newCh ild, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& = ASSERT_NO_EXCEPTIO N); 227 PassRefPtrWillBeRawPtr<Node> replaceChild(PassRefPtrWillBeRawPtr<Node> newCh ild, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& = ASSERT_NO_EXCEPTIO N);
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } // namespace blink 925 } // namespace blink
918 926
919 #ifndef NDEBUG 927 #ifndef NDEBUG
920 // Outside the WebCore namespace for ease of invocation from gdb. 928 // Outside the WebCore namespace for ease of invocation from gdb.
921 void showNode(const blink::Node*); 929 void showNode(const blink::Node*);
922 void showTree(const blink::Node*); 930 void showTree(const blink::Node*);
923 void showNodePath(const blink::Node*); 931 void showNodePath(const blink::Node*);
924 #endif 932 #endif
925 933
926 #endif // Node_h 934 #endif // Node_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698