Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / layout / inspector / inDeepTreeWalker.h
blobb421e0831bbea74c5df3d62e0eddf285da43b254
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 #ifndef __inDeepTreeWalker_h___
8 #define __inDeepTreeWalker_h___
10 #include "inIDeepTreeWalker.h"
12 #include "nsCOMPtr.h"
13 #include "nsINode.h"
14 #include "nsTArray.h"
16 class nsINodeList;
18 class inDeepTreeWalker final : public inIDeepTreeWalker {
19 public:
20 NS_DECL_ISUPPORTS
21 NS_DECL_INIDEEPTREEWALKER
23 inDeepTreeWalker();
25 using ChildList = AutoTArray<RefPtr<nsINode>, 8>;
26 void GetChildren(nsINode& aParent, ChildList&);
28 protected:
29 virtual ~inDeepTreeWalker();
31 already_AddRefed<nsINode> GetParent();
32 nsresult EdgeChild(nsINode** _retval, bool aReverse);
34 bool mShowAnonymousContent = false;
35 bool mShowSubDocuments = false;
36 bool mShowDocumentsAsNodes = false;
38 // The root node. previousNode and parentNode will return
39 // null from here.
40 nsCOMPtr<nsINode> mRoot;
41 nsCOMPtr<nsINode> mCurrentNode;
43 // We cache the siblings of mCurrentNode as a list of nodes.
44 // Notes: normally siblings are all the children of the parent
45 // of mCurrentNode (that are interesting for use for the walk)
46 // and mCurrentIndex is the index of mCurrentNode in that list
47 ChildList mSiblings;
49 // Index of mCurrentNode in the mSiblings list.
50 int32_t mCurrentIndex = -1;
53 // {BFCB82C2-5611-4318-90D6-BAF4A7864252}
54 #define IN_DEEPTREEWALKER_CID \
55 { \
56 0xbfcb82c2, 0x5611, 0x4318, { \
57 0x90, 0xd6, 0xba, 0xf4, 0xa7, 0x86, 0x42, 0x52 \
58 } \
61 #endif // __inDeepTreeWalker_h___