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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 NodeIteratorBase::NodeIteratorBase(Node* rootNode, | 33 NodeIteratorBase::NodeIteratorBase(Node* rootNode, |
34 unsigned whatToShow, | 34 unsigned whatToShow, |
35 NodeFilter* nodeFilter) | 35 NodeFilter* nodeFilter) |
36 : m_root(rootNode), m_whatToShow(whatToShow), m_filter(nodeFilter) {} | 36 : m_root(rootNode), m_whatToShow(whatToShow), m_filter(nodeFilter) {} |
37 | 37 |
38 unsigned NodeIteratorBase::acceptNode(Node* node, | 38 unsigned NodeIteratorBase::acceptNode(Node* node, |
39 ExceptionState& exceptionState) const { | 39 ExceptionState& exceptionState) const { |
40 // The bit twiddling here is done to map DOM node types, which are given as in
tegers from | 40 // The bit twiddling here is done to map DOM node types, which are given as |
41 // 1 through 14, to whatToShow bit masks. | 41 // integers from 1 through 14, to whatToShow bit masks. |
42 if (!(((1 << (node->getNodeType() - 1)) & m_whatToShow))) | 42 if (!(((1 << (node->getNodeType() - 1)) & m_whatToShow))) |
43 return NodeFilter::kFilterSkip; | 43 return NodeFilter::kFilterSkip; |
44 if (!m_filter) | 44 if (!m_filter) |
45 return NodeFilter::kFilterAccept; | 45 return NodeFilter::kFilterAccept; |
46 return m_filter->acceptNode(node, exceptionState); | 46 return m_filter->acceptNode(node, exceptionState); |
47 } | 47 } |
48 | 48 |
49 DEFINE_TRACE(NodeIteratorBase) { | 49 DEFINE_TRACE(NodeIteratorBase) { |
50 visitor->trace(m_root); | 50 visitor->trace(m_root); |
51 visitor->trace(m_filter); | 51 visitor->trace(m_filter); |
52 } | 52 } |
53 | 53 |
54 DEFINE_TRACE_WRAPPERS(NodeIteratorBase) { | 54 DEFINE_TRACE_WRAPPERS(NodeIteratorBase) { |
55 visitor->traceWrappers(m_filter); | 55 visitor->traceWrappers(m_filter); |
56 } | 56 } |
57 | 57 |
58 } // namespace blink | 58 } // namespace blink |
OLD | NEW |