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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 { | 127 { |
128 unsigned selectorCount = m_selectors.size(); | 128 unsigned selectorCount = m_selectors.size(); |
129 for (unsigned i = 0; i < selectorCount; ++i) { | 129 for (unsigned i = 0; i < selectorCount; ++i) { |
130 if (selectorMatches(*m_selectors[i], targetElement, targetElement)) | 130 if (selectorMatches(*m_selectors[i], targetElement, targetElement)) |
131 return true; | 131 return true; |
132 } | 132 } |
133 | 133 |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 PassRefPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootNode) const | 137 PassRefPtrWillBeRawPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootN
ode) const |
138 { | 138 { |
139 Vector<RefPtr<Node> > result; | 139 Vector<RefPtr<Node> > result; |
140 execute<AllElementsSelectorQueryTrait>(rootNode, result); | 140 execute<AllElementsSelectorQueryTrait>(rootNode, result); |
141 return StaticNodeList::adopt(result); | 141 return StaticNodeList::adopt(result); |
142 } | 142 } |
143 | 143 |
144 PassRefPtr<Element> SelectorDataList::queryFirst(ContainerNode& rootNode) const | 144 PassRefPtr<Element> SelectorDataList::queryFirst(ContainerNode& rootNode) const |
145 { | 145 { |
146 Element* matchedElement = 0; | 146 Element* matchedElement = 0; |
147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); | 147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 : m_selectorList(selectorList) | 468 : m_selectorList(selectorList) |
469 { | 469 { |
470 m_selectors.initialize(m_selectorList); | 470 m_selectors.initialize(m_selectorList); |
471 } | 471 } |
472 | 472 |
473 bool SelectorQuery::matches(Element& element) const | 473 bool SelectorQuery::matches(Element& element) const |
474 { | 474 { |
475 return m_selectors.matches(element); | 475 return m_selectors.matches(element); |
476 } | 476 } |
477 | 477 |
478 PassRefPtr<NodeList> SelectorQuery::queryAll(ContainerNode& rootNode) const | 478 PassRefPtrWillBeRawPtr<NodeList> SelectorQuery::queryAll(ContainerNode& rootNode
) const |
479 { | 479 { |
480 return m_selectors.queryAll(rootNode); | 480 return m_selectors.queryAll(rootNode); |
481 } | 481 } |
482 | 482 |
483 PassRefPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNode) const | 483 PassRefPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNode) const |
484 { | 484 { |
485 return m_selectors.queryFirst(rootNode); | 485 return m_selectors.queryFirst(rootNode); |
486 } | 486 } |
487 | 487 |
488 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu
ment& document, ExceptionState& exceptionState) | 488 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu
ment& document, ExceptionState& exceptionState) |
(...skipping 26 matching lines...) Expand all Loading... |
515 m_entries.add(selectors, selectorQuery.release()); | 515 m_entries.add(selectors, selectorQuery.release()); |
516 return rawSelectorQuery; | 516 return rawSelectorQuery; |
517 } | 517 } |
518 | 518 |
519 void SelectorQueryCache::invalidate() | 519 void SelectorQueryCache::invalidate() |
520 { | 520 { |
521 m_entries.clear(); | 521 m_entries.clear(); |
522 } | 522 } |
523 | 523 |
524 } | 524 } |
OLD | NEW |