/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* * Tests if and how a node should be filtered. Uses mWhatToShow and * mFilter to test the node. * @param aNode Node to test * @param aResult Whether we succeeded * @returns Filtervalue. See NodeFilter.webidl
*/
int16_t nsTraversal::TestNode(nsINode* aNode, mozilla::ErrorResult& aResult,
nsCOMPtr<nsINode>* aUnskippedNode) { if (mInAcceptNode) {
aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return 0;
}
if (!mFilter) { // No filter, just accept return NodeFilter_Binding::FILTER_ACCEPT;
}
AutoRestore<bool> inAcceptNode(mInAcceptNode);
mInAcceptNode = true; // No need to pass in an execution reason, since the generated default, // "NodeFilter.acceptNode", is pretty much exactly what we'd say anyway. return mFilter->AcceptNode(*aNode, aResult, nullptr,
CallbackObject::eRethrowExceptions);
}
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.