OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 m_currentNode = 0; | 57 m_currentNode = 0; |
58 return current; | 58 return current; |
59 } | 59 } |
60 | 60 |
61 private: | 61 private: |
62 Node* m_currentNode; | 62 Node* m_currentNode; |
63 }; | 63 }; |
64 | 64 |
65 class ClassRootNodeList : public SimpleNodeList { | 65 class ClassRootNodeList : public SimpleNodeList { |
66 public: | 66 public: |
67 explicit ClassRootNodeList(Node* rootNode, const AtomicString& className) | 67 explicit ClassRootNodeList(Node* rootNode, const AtomicString& className) |
haraken
2013/10/07 07:08:49
Nit: 'explicit' is not needed.
tasak
2013/10/07 07:34:34
Done.
| |
68 : m_className(className) | 68 : m_className(className) |
69 , m_rootNode(rootNode) | 69 , m_rootNode(rootNode) |
70 , m_currentElement(nextInternal(ElementTraversal::firstWithin(rootNode)) ) { } | 70 , m_currentElement(nextInternal(rootNode && rootNode->isElementNode() ? toElement(rootNode) : ElementTraversal::firstWithin(rootNode))) { } |
71 | 71 |
72 bool isEmpty() const { return !m_currentElement; } | 72 bool isEmpty() const { return !m_currentElement; } |
73 | 73 |
74 Node* next() | 74 Node* next() |
75 { | 75 { |
76 Node* current = m_currentElement; | 76 Node* current = m_currentElement; |
77 ASSERT(current); | 77 ASSERT(current); |
78 m_currentElement = nextInternal(ElementTraversal::nextSkippingChildren(m _currentElement, m_rootNode)); | 78 m_currentElement = nextInternal(ElementTraversal::nextSkippingChildren(m _currentElement, m_rootNode)); |
79 return current; | 79 return current; |
80 } | 80 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 m_entries.add(selectors, selectorQuery.release()); | 510 m_entries.add(selectors, selectorQuery.release()); |
511 return rawSelectorQuery; | 511 return rawSelectorQuery; |
512 } | 512 } |
513 | 513 |
514 void SelectorQueryCache::invalidate() | 514 void SelectorQueryCache::invalidate() |
515 { | 515 { |
516 m_entries.clear(); | 516 m_entries.clear(); |
517 } | 517 } |
518 | 518 |
519 } | 519 } |
OLD | NEW |