Bug 1835710 - Cancel off-thread JIT compilation before changing nursery allocation...
[gecko.git] / dom / base / nsTraversal.h
blob801e4a291cce69541220df007343b6f0a4b885da
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/dom/NodeFilterBinding.h"
18 class nsINode;
20 namespace mozilla {
21 class ErrorResult;
24 class nsTraversal {
25 public:
26 nsTraversal(nsINode* aRoot, uint32_t aWhatToShow,
27 mozilla::dom::NodeFilter* aFilter);
28 virtual ~nsTraversal();
30 protected:
31 nsCOMPtr<nsINode> mRoot;
32 uint32_t mWhatToShow;
33 RefPtr<mozilla::dom::NodeFilter> mFilter;
34 bool mInAcceptNode;
37 * Tests if and how a node should be filtered. Uses mWhatToShow and
38 * mFilter to test the node.
39 * @param aNode Node to test
40 * @param aResult Whether we succeeded
41 * @param aUnskippedNode If non-null is passed, set to aNode if node isn't
42 * filtered out by mWhatToShow.
43 * @returns Filtervalue. See NodeFilter.webidl
45 int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult,
46 nsCOMPtr<nsINode>* aUnskippedNode = nullptr);
49 #endif