| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 { | 128 { |
| 129 unsigned selectorCount = m_selectors.size(); | 129 unsigned selectorCount = m_selectors.size(); |
| 130 for (unsigned i = 0; i < selectorCount; ++i) { | 130 for (unsigned i = 0; i < selectorCount; ++i) { |
| 131 if (selectorMatches(*m_selectors[i], targetElement, targetElement)) | 131 if (selectorMatches(*m_selectors[i], targetElement, targetElement)) |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 PassRefPtrWillBeRawPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootN
ode) const | 138 PassRefPtrWillBeRawPtr<StaticNodeList> SelectorDataList::queryAll(ContainerNode&
rootNode) const |
| 139 { | 139 { |
| 140 WillBeHeapVector<RefPtrWillBeMember<Node> > result; | 140 WillBeHeapVector<RefPtrWillBeMember<Node> > result; |
| 141 execute<AllElementsSelectorQueryTrait>(rootNode, result); | 141 execute<AllElementsSelectorQueryTrait>(rootNode, result); |
| 142 return StaticNodeList::adopt(result); | 142 return StaticNodeList::adopt(result); |
| 143 } | 143 } |
| 144 | 144 |
| 145 PassRefPtrWillBeRawPtr<Element> SelectorDataList::queryFirst(ContainerNode& root
Node) const | 145 PassRefPtrWillBeRawPtr<Element> SelectorDataList::queryFirst(ContainerNode& root
Node) const |
| 146 { | 146 { |
| 147 Element* matchedElement = 0; | 147 Element* matchedElement = 0; |
| 148 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); | 148 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 { | 474 { |
| 475 m_selectorList.adopt(selectorList); | 475 m_selectorList.adopt(selectorList); |
| 476 m_selectors.initialize(m_selectorList); | 476 m_selectors.initialize(m_selectorList); |
| 477 } | 477 } |
| 478 | 478 |
| 479 bool SelectorQuery::matches(Element& element) const | 479 bool SelectorQuery::matches(Element& element) const |
| 480 { | 480 { |
| 481 return m_selectors.matches(element); | 481 return m_selectors.matches(element); |
| 482 } | 482 } |
| 483 | 483 |
| 484 PassRefPtrWillBeRawPtr<NodeList> SelectorQuery::queryAll(ContainerNode& rootNode
) const | 484 PassRefPtrWillBeRawPtr<StaticNodeList> SelectorQuery::queryAll(ContainerNode& ro
otNode) const |
| 485 { | 485 { |
| 486 return m_selectors.queryAll(rootNode); | 486 return m_selectors.queryAll(rootNode); |
| 487 } | 487 } |
| 488 | 488 |
| 489 PassRefPtrWillBeRawPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNod
e) const | 489 PassRefPtrWillBeRawPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNod
e) const |
| 490 { | 490 { |
| 491 return m_selectors.queryFirst(rootNode); | 491 return m_selectors.queryFirst(rootNode); |
| 492 } | 492 } |
| 493 | 493 |
| 494 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu
ment& document, ExceptionState& exceptionState) | 494 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu
ment& document, ExceptionState& exceptionState) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 518 | 518 |
| 519 return m_entries.add(selectors, SelectorQuery::adopt(selectorList)).storedVa
lue->value.get(); | 519 return m_entries.add(selectors, SelectorQuery::adopt(selectorList)).storedVa
lue->value.get(); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void SelectorQueryCache::invalidate() | 522 void SelectorQueryCache::invalidate() |
| 523 { | 523 { |
| 524 m_entries.clear(); | 524 m_entries.clear(); |
| 525 } | 525 } |
| 526 | 526 |
| 527 } | 527 } |
| OLD | NEW |