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.)

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  *
     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 DOM Traversal's nsIDOMTreeWalker
     9  */
    11 #ifndef nsTraversal_h___
    12 #define nsTraversal_h___
    14 #include "nsCOMPtr.h"
    15 #include "nsIDocument.h"
    16 #include "mozilla/dom/CallbackObject.h"
    17 #include "mozilla/ErrorResult.h"
    18 #include "mozilla/dom/NodeFilterBinding.h"
    19 #include "nsIDOMNodeFilter.h"
    21 class nsINode;
    23 class nsTraversal
    24 {
    25 public:
    26     nsTraversal(nsINode *aRoot,
    27                 uint32_t aWhatToShow,
    28                 const mozilla::dom::NodeFilterHolder &aFilter);
    29     virtual ~nsTraversal();
    31 protected:
    32     nsCOMPtr<nsINode> mRoot;
    33     uint32_t mWhatToShow;
    34     mozilla::dom::NodeFilterHolder mFilter;
    35     bool mInAcceptNode;
    37     /*
    38      * Tests if and how a node should be filtered. Uses mWhatToShow and
    39      * mFilter to test the node.
    40      * @param aNode     Node to test
    41      * @param aResult   Whether we succeeded
    42      * @returns         Filtervalue. See nsIDOMNodeFilter.idl
    43      */
    44     int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult);
    45 };
    47 #endif

mercurial