content/base/src/nsTraversal.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /*
michael@0 8 * Implementation of DOM Traversal's nsIDOMTreeWalker
michael@0 9 */
michael@0 10
michael@0 11 #ifndef nsTraversal_h___
michael@0 12 #define nsTraversal_h___
michael@0 13
michael@0 14 #include "nsCOMPtr.h"
michael@0 15 #include "nsIDocument.h"
michael@0 16 #include "mozilla/dom/CallbackObject.h"
michael@0 17 #include "mozilla/ErrorResult.h"
michael@0 18 #include "mozilla/dom/NodeFilterBinding.h"
michael@0 19 #include "nsIDOMNodeFilter.h"
michael@0 20
michael@0 21 class nsINode;
michael@0 22
michael@0 23 class nsTraversal
michael@0 24 {
michael@0 25 public:
michael@0 26 nsTraversal(nsINode *aRoot,
michael@0 27 uint32_t aWhatToShow,
michael@0 28 const mozilla::dom::NodeFilterHolder &aFilter);
michael@0 29 virtual ~nsTraversal();
michael@0 30
michael@0 31 protected:
michael@0 32 nsCOMPtr<nsINode> mRoot;
michael@0 33 uint32_t mWhatToShow;
michael@0 34 mozilla::dom::NodeFilterHolder mFilter;
michael@0 35 bool mInAcceptNode;
michael@0 36
michael@0 37 /*
michael@0 38 * Tests if and how a node should be filtered. Uses mWhatToShow and
michael@0 39 * mFilter to test the node.
michael@0 40 * @param aNode Node to test
michael@0 41 * @param aResult Whether we succeeded
michael@0 42 * @returns Filtervalue. See nsIDOMNodeFilter.idl
michael@0 43 */
michael@0 44 int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult);
michael@0 45 };
michael@0 46
michael@0 47 #endif
michael@0 48

mercurial