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

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

Issue 330713003: Update SelectorQuery constructor to adopt CSSSelectorList object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename to adopt 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 | « no previous file | 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const CSSSelector* selectorForIdLookup(const CSSSelector&) const; 81 const CSSSelector* selectorForIdLookup(const CSSSelector&) const;
82 82
83 Vector<const CSSSelector*> m_selectors; 83 Vector<const CSSSelector*> m_selectors;
84 bool m_crossesTreeBoundary; 84 bool m_crossesTreeBoundary;
85 }; 85 };
86 86
87 class SelectorQuery { 87 class SelectorQuery {
88 WTF_MAKE_NONCOPYABLE(SelectorQuery); 88 WTF_MAKE_NONCOPYABLE(SelectorQuery);
89 WTF_MAKE_FAST_ALLOCATED; 89 WTF_MAKE_FAST_ALLOCATED;
90 public: 90 public:
91 explicit SelectorQuery(const CSSSelectorList&); 91 static PassOwnPtr<SelectorQuery> adopt(CSSSelectorList&);
92
92 bool matches(Element&) const; 93 bool matches(Element&) const;
93 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const; 94 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const;
94 PassRefPtrWillBeRawPtr<Element> queryFirst(ContainerNode& rootNode) const; 95 PassRefPtrWillBeRawPtr<Element> queryFirst(ContainerNode& rootNode) const;
95 private: 96 private:
97 explicit SelectorQuery(CSSSelectorList&);
98
96 SelectorDataList m_selectors; 99 SelectorDataList m_selectors;
97 CSSSelectorList m_selectorList; 100 CSSSelectorList m_selectorList;
98 }; 101 };
99 102
100 class SelectorQueryCache { 103 class SelectorQueryCache {
101 WTF_MAKE_FAST_ALLOCATED; 104 WTF_MAKE_FAST_ALLOCATED;
102 public: 105 public:
103 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&); 106 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&);
104 void invalidate(); 107 void invalidate();
105 108
106 private: 109 private:
107 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries; 110 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries;
108 }; 111 };
109 112
110 } 113 }
111 114
112 #endif 115 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698