| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 3 * Copyright (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
| 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 4 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeIteratorBase); | 34 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeIteratorBase); |
| 35 | 35 |
| 36 NodeIteratorBase::NodeIteratorBase(PassRefPtrWillBeRawPtr<Node> rootNode, unsign
ed whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> nodeFilter) | 36 NodeIteratorBase::NodeIteratorBase(PassRefPtrWillBeRawPtr<Node> rootNode, unsign
ed whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> nodeFilter) |
| 37 : m_root(rootNode) | 37 : m_root(rootNode) |
| 38 , m_whatToShow(whatToShow) | 38 , m_whatToShow(whatToShow) |
| 39 , m_filter(nodeFilter) | 39 , m_filter(nodeFilter) |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 short NodeIteratorBase::acceptNode(Node* node, ExceptionState& exceptionState) c
onst | 43 unsigned NodeIteratorBase::acceptNode(Node* node, ExceptionState& exceptionState
) const |
| 44 { | 44 { |
| 45 // The bit twiddling here is done to map DOM node types, which are given as
integers from | 45 // The bit twiddling here is done to map DOM node types, which are given as
integers from |
| 46 // 1 through 14, to whatToShow bit masks. | 46 // 1 through 14, to whatToShow bit masks. |
| 47 if (!(((1 << (node->nodeType() - 1)) & m_whatToShow))) | 47 if (!(((1 << (node->nodeType() - 1)) & m_whatToShow))) |
| 48 return NodeFilter::FILTER_SKIP; | 48 return NodeFilter::FILTER_SKIP; |
| 49 if (!m_filter) | 49 if (!m_filter) |
| 50 return NodeFilter::FILTER_ACCEPT; | 50 return NodeFilter::FILTER_ACCEPT; |
| 51 return m_filter->acceptNode(node, exceptionState); | 51 return m_filter->acceptNode(node, exceptionState); |
| 52 } | 52 } |
| 53 | 53 |
| 54 DEFINE_TRACE(NodeIteratorBase) | 54 DEFINE_TRACE(NodeIteratorBase) |
| 55 { | 55 { |
| 56 visitor->trace(m_root); | 56 visitor->trace(m_root); |
| 57 visitor->trace(m_filter); | 57 visitor->trace(m_filter); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |