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

Side by Side Diff: third_party/WebKit/Source/core/dom/SelectorQuery.h

Issue 2785253002: Reuse executeForTraverseRoot to avoid a manual loop in SelectorQuery::findTraverseRootsAndExecute. (Closed)
Patch Set: woops Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 template <typename SelectorQueryTrait> 76 template <typename SelectorQueryTrait>
77 void executeForTraverseRoot(ContainerNode* traverseRoot, 77 void executeForTraverseRoot(ContainerNode& traverseRoot,
78 ContainerNode& rootNode, 78 ContainerNode& rootNode,
79 typename SelectorQueryTrait::OutputType&) const; 79 typename SelectorQueryTrait::OutputType&) const;
80 template <typename SelectorQueryTrait> 80 template <typename SelectorQueryTrait>
81 bool selectorListMatches(ContainerNode& rootNode, 81 bool selectorListMatches(ContainerNode& rootNode,
82 Element&, 82 Element&,
83 typename SelectorQueryTrait::OutputType&) const; 83 typename SelectorQueryTrait::OutputType&) const;
84 template <typename SelectorQueryTrait> 84 template <typename SelectorQueryTrait>
85 void executeSlow(ContainerNode& rootNode, 85 void executeSlow(ContainerNode& rootNode,
86 typename SelectorQueryTrait::OutputType&) const; 86 typename SelectorQueryTrait::OutputType&) const;
87 template <typename SelectorQueryTrait> 87 template <typename SelectorQueryTrait>
(...skipping 21 matching lines...) Expand all
109 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&); 109 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&);
110 void invalidate(); 110 void invalidate();
111 111
112 private: 112 private:
113 HashMap<AtomicString, std::unique_ptr<SelectorQuery>> m_entries; 113 HashMap<AtomicString, std::unique_ptr<SelectorQuery>> m_entries;
114 }; 114 };
115 115
116 } // namespace blink 116 } // namespace blink
117 117
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698