OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. |
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 private: | 67 private: |
68 explicit SelectorQuery(CSSSelectorList); | 68 explicit SelectorQuery(CSSSelectorList); |
69 | 69 |
70 bool canUseFastQuery(const ContainerNode& rootNode) const; | 70 bool canUseFastQuery(const ContainerNode& rootNode) const; |
71 | 71 |
72 template <typename SelectorQueryTrait> | 72 template <typename SelectorQueryTrait> |
73 void findTraverseRootsAndExecute( | 73 void findTraverseRootsAndExecute( |
74 ContainerNode& rootNode, | 74 ContainerNode& rootNode, |
75 typename SelectorQueryTrait::OutputType&) const; | 75 typename SelectorQueryTrait::OutputType&) const; |
76 | |
77 enum MatchTraverseRootState { | |
78 DoesNotMatchTraverseRoots, | |
79 MatchesTraverseRoots | |
80 }; | |
81 template <typename SelectorQueryTrait> | 76 template <typename SelectorQueryTrait> |
82 void executeForTraverseRoot(ContainerNode* traverseRoot, | 77 void executeForTraverseRoot(ContainerNode* traverseRoot, |
83 ContainerNode& rootNode, | 78 ContainerNode& rootNode, |
84 typename SelectorQueryTrait::OutputType&) const; | 79 typename SelectorQueryTrait::OutputType&) const; |
85 template <typename SelectorQueryTrait, typename SimpleElementListType> | |
86 void executeForTraverseRoots(SimpleElementListType& traverseRoots, | |
87 MatchTraverseRootState, | |
88 ContainerNode& rootNode, | |
89 typename SelectorQueryTrait::OutputType&) const; | |
90 | |
91 template <typename SelectorQueryTrait> | 80 template <typename SelectorQueryTrait> |
92 bool selectorListMatches(ContainerNode& rootNode, | 81 bool selectorListMatches(ContainerNode& rootNode, |
93 Element&, | 82 Element&, |
94 typename SelectorQueryTrait::OutputType&) const; | 83 typename SelectorQueryTrait::OutputType&) const; |
95 template <typename SelectorQueryTrait> | 84 template <typename SelectorQueryTrait> |
96 void executeSlow(ContainerNode& rootNode, | 85 void executeSlow(ContainerNode& rootNode, |
97 typename SelectorQueryTrait::OutputType&) const; | 86 typename SelectorQueryTrait::OutputType&) const; |
98 template <typename SelectorQueryTrait> | 87 template <typename SelectorQueryTrait> |
99 void executeSlowTraversingShadowTree( | 88 void executeSlowTraversingShadowTree( |
100 ContainerNode& rootNode, | 89 ContainerNode& rootNode, |
(...skipping 19 matching lines...) Expand all Loading... |
120 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&); | 109 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&); |
121 void invalidate(); | 110 void invalidate(); |
122 | 111 |
123 private: | 112 private: |
124 HashMap<AtomicString, std::unique_ptr<SelectorQuery>> m_entries; | 113 HashMap<AtomicString, std::unique_ptr<SelectorQuery>> m_entries; |
125 }; | 114 }; |
126 | 115 |
127 } // namespace blink | 116 } // namespace blink |
128 | 117 |
129 #endif | 118 #endif |
OLD | NEW |