Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Side by Side Diff: Source/core/dom/SelectorQuery.cpp

Issue 334713006: Use stricter typing for NodeLists throughout the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/SelectorQuery.h ('k') | Source/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/dom/SelectorQuery.h ('k') | Source/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698