Bug 1665252 - remove allowpaymentrequest attribute from HTMLIFrameElement r=dom-worke...
[gecko.git] / dom / base / nsTraversal.h
blobd340f5cae05083390448e50acd25ad9dfc3a15c7
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * Implementation of common traversal methods for TreeWalker and NodeIterator.
9 */
11 #ifndef nsTraversal_h___
12 #define nsTraversal_h___
14 #include "nsCOMPtr.h"
15 #include "mozilla/dom/CallbackObject.h"
16 #include "mozilla/ErrorResult.h"
17 #include "mozilla/dom/NodeFilterBinding.h"
19 class nsINode;
21 class nsTraversal {
22 public:
23 nsTraversal(nsINode* aRoot, uint32_t aWhatToShow,
24 mozilla::dom::NodeFilter* aFilter);
25 virtual ~nsTraversal();
27 protected:
28 nsCOMPtr<nsINode> mRoot;
29 uint32_t mWhatToShow;
30 RefPtr<mozilla::dom::NodeFilter> mFilter;
31 bool mInAcceptNode;
34 * Tests if and how a node should be filtered. Uses mWhatToShow and
35 * mFilter to test the node.
36 * @param aNode Node to test
37 * @param aResult Whether we succeeded
38 * @param aUnskippedNode If non-null is passed, set to aNode if node isn't
39 * filtered out by mWhatToShow.
40 * @returns Filtervalue. See NodeFilter.webidl
42 int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult,
43 nsCOMPtr<nsINode>* aUnskippedNode = nullptr);
46 #endif