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

Side by Side Diff: third_party/WebKit/Source/core/dom/NodeIterator.h

Issue 2840163002: DOM: NodeIterator.filter and TreeWalker.filter should return values which were specified to createN… (Closed)
Patch Set: Move ToV8() to ToV8ForCore.h, etc. Created 3 years, 8 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 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
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
(...skipping 25 matching lines...) Expand all
36 36
37 class NodeIterator final : public GarbageCollected<NodeIterator>, 37 class NodeIterator final : public GarbageCollected<NodeIterator>,
38 public ScriptWrappable, 38 public ScriptWrappable,
39 public NodeIteratorBase { 39 public NodeIteratorBase {
40 DEFINE_WRAPPERTYPEINFO(); 40 DEFINE_WRAPPERTYPEINFO();
41 USING_GARBAGE_COLLECTED_MIXIN(NodeIterator); 41 USING_GARBAGE_COLLECTED_MIXIN(NodeIterator);
42 42
43 public: 43 public:
44 static NodeIterator* Create(Node* root_node, 44 static NodeIterator* Create(Node* root_node,
45 unsigned what_to_show, 45 unsigned what_to_show,
46 NodeFilter* filter) { 46 V8NodeFilterCondition* filter) {
47 return new NodeIterator(root_node, what_to_show, filter); 47 return new NodeIterator(root_node, what_to_show, filter);
48 } 48 }
49 49
50 Node* nextNode(ExceptionState&); 50 Node* nextNode(ExceptionState&);
51 Node* previousNode(ExceptionState&); 51 Node* previousNode(ExceptionState&);
52 void detach(); 52 void detach();
53 53
54 Node* referenceNode() const { return reference_node_.node.Get(); } 54 Node* referenceNode() const { return reference_node_.node.Get(); }
55 bool pointerBeforeReferenceNode() const { 55 bool pointerBeforeReferenceNode() const {
56 return reference_node_.is_pointer_before_node; 56 return reference_node_.is_pointer_before_node;
57 } 57 }
58 58
59 // This function is called before any node is removed from the document tree. 59 // This function is called before any node is removed from the document tree.
60 void NodeWillBeRemoved(Node&); 60 void NodeWillBeRemoved(Node&);
61 61
62 DECLARE_VIRTUAL_TRACE(); 62 DECLARE_VIRTUAL_TRACE();
63 63
64 DECLARE_VIRTUAL_TRACE_WRAPPERS(); 64 DECLARE_VIRTUAL_TRACE_WRAPPERS();
65 65
66 private: 66 private:
67 NodeIterator(Node*, unsigned what_to_show, NodeFilter*); 67 NodeIterator(Node*, unsigned what_to_show, V8NodeFilterCondition*);
68 68
69 class NodePointer { 69 class NodePointer {
70 DISALLOW_NEW(); 70 DISALLOW_NEW();
71 71
72 public: 72 public:
73 NodePointer(); 73 NodePointer();
74 NodePointer(Node*, bool); 74 NodePointer(Node*, bool);
75 75
76 void Clear(); 76 void Clear();
77 bool MoveToNext(Node* root); 77 bool MoveToNext(Node* root);
78 bool MoveToPrevious(Node* root); 78 bool MoveToPrevious(Node* root);
79 79
80 Member<Node> node; 80 Member<Node> node;
81 bool is_pointer_before_node; 81 bool is_pointer_before_node;
82 82
83 DEFINE_INLINE_TRACE() { visitor->Trace(node); } 83 DEFINE_INLINE_TRACE() { visitor->Trace(node); }
84 }; 84 };
85 85
86 void UpdateForNodeRemoval(Node& node_to_be_removed, NodePointer&) const; 86 void UpdateForNodeRemoval(Node& node_to_be_removed, NodePointer&) const;
87 87
88 NodePointer reference_node_; 88 NodePointer reference_node_;
89 NodePointer candidate_node_; 89 NodePointer candidate_node_;
90 }; 90 };
91 91
92 } // namespace blink 92 } // namespace blink
93 93
94 #endif // NodeIterator_h 94 #endif // NodeIterator_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeFilterCondition.h ('k') | third_party/WebKit/Source/core/dom/NodeIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698