| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 PassRefPtr<Element> queryFirst(Node* rootNode) const; | 49 PassRefPtr<Element> queryFirst(Node* rootNode) const; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 struct SelectorData { | 52 struct SelectorData { |
| 53 SelectorData(const CSSSelector* selector, bool isFastCheckable) : select
or(selector), isFastCheckable(isFastCheckable) { } | 53 SelectorData(const CSSSelector* selector, bool isFastCheckable) : select
or(selector), isFastCheckable(isFastCheckable) { } |
| 54 const CSSSelector* selector; | 54 const CSSSelector* selector; |
| 55 bool isFastCheckable; | 55 bool isFastCheckable; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 bool selectorMatches(const SelectorData&, Element*, const Node*) const; | 58 bool selectorMatches(const SelectorData&, Element*, const Node*) const; |
| 59 bool canUseIdLookup(Node* rootNode) const; | 59 std::pair<bool, Node*> findTraverseRoot(Node* traverseRoot) const; |
| 60 template <bool firstMatchOnly> | 60 template <bool firstMatchOnly> |
| 61 void execute(Node* rootNode, Vector<RefPtr<Node> >&) const; | 61 void execute(Node* rootNode, Vector<RefPtr<Node> >&) const; |
| 62 | 62 |
| 63 Vector<SelectorData> m_selectors; | 63 Vector<SelectorData> m_selectors; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class SelectorQuery { | 66 class SelectorQuery { |
| 67 WTF_MAKE_NONCOPYABLE(SelectorQuery); | 67 WTF_MAKE_NONCOPYABLE(SelectorQuery); |
| 68 WTF_MAKE_FAST_ALLOCATED; | 68 WTF_MAKE_FAST_ALLOCATED; |
| 69 public: | 69 public: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 82 SelectorQuery* add(const AtomicString&, Document*, ExceptionCode&); | 82 SelectorQuery* add(const AtomicString&, Document*, ExceptionCode&); |
| 83 void invalidate(); | 83 void invalidate(); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries; | 86 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } | 89 } |
| 90 | 90 |
| 91 #endif | 91 #endif |
| OLD | NEW |