OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/dom/CSSSelectorWatch.h" | 31 #include "core/dom/CSSSelectorWatch.h" |
32 | 32 |
33 #include "core/css/StylePropertySet.h" | 33 #include "core/css/StylePropertySet.h" |
34 #include "core/css/parser/CSSParser.h" | 34 #include "core/css/parser/CSSParser.h" |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/dom/ExecutionContext.h" | 36 #include "core/dom/ExecutionContext.h" |
| 37 #include "core/dom/StyleEngine.h" |
37 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
38 #include "core/loader/FrameLoaderClient.h" | 39 #include "core/loader/FrameLoaderClient.h" |
39 #include "core/style/StyleRareNonInheritedData.h" | 40 #include "core/style/StyleRareNonInheritedData.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 // The address of this string is important; its value is just documentation. | 44 // The address of this string is important; its value is just documentation. |
44 static const char kSupplementName[] = "CSSSelectorWatch"; | 45 static const char kSupplementName[] = "CSSSelectorWatch"; |
45 | 46 |
46 CSSSelectorWatch::CSSSelectorWatch(Document& document) | 47 CSSSelectorWatch::CSSSelectorWatch(Document& document) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 CSSSelectorList selectorList = CSSParser::parseSelector(CSSParserContext
(UASheetMode, 0), nullptr, selectors[i]); | 152 CSSSelectorList selectorList = CSSParser::parseSelector(CSSParserContext
(UASheetMode, 0), nullptr, selectors[i]); |
152 if (!selectorList.isValid()) | 153 if (!selectorList.isValid()) |
153 continue; | 154 continue; |
154 | 155 |
155 // Only accept Compound Selectors, since they're cheaper to match. | 156 // Only accept Compound Selectors, since they're cheaper to match. |
156 if (!allCompound(selectorList)) | 157 if (!allCompound(selectorList)) |
157 continue; | 158 continue; |
158 | 159 |
159 m_watchedCallbackSelectors.append(StyleRule::create(std::move(selectorLi
st), callbackPropertySet)); | 160 m_watchedCallbackSelectors.append(StyleRule::create(std::move(selectorLi
st), callbackPropertySet)); |
160 } | 161 } |
161 document().changedSelectorWatch(); | 162 document().styleEngine().watchedSelectorsChanged(); |
162 } | 163 } |
163 | 164 |
164 DEFINE_TRACE(CSSSelectorWatch) | 165 DEFINE_TRACE(CSSSelectorWatch) |
165 { | 166 { |
166 visitor->trace(m_watchedCallbackSelectors); | 167 visitor->trace(m_watchedCallbackSelectors); |
167 visitor->trace(m_document); | 168 visitor->trace(m_document); |
168 WillBeHeapSupplement<Document>::trace(visitor); | 169 WillBeHeapSupplement<Document>::trace(visitor); |
169 } | 170 } |
170 | 171 |
171 } // namespace blink | 172 } // namespace blink |
OLD | NEW |