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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.h

Issue 1757503002: Re-collect rule features for watched selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 PassRefPtr<ComputedStyle> styleForPage(int pageIndex); 97 PassRefPtr<ComputedStyle> styleForPage(int pageIndex);
98 PassRefPtr<ComputedStyle> styleForText(Text*); 98 PassRefPtr<ComputedStyle> styleForText(Text*);
99 99
100 static PassRefPtr<ComputedStyle> styleForDocument(Document&); 100 static PassRefPtr<ComputedStyle> styleForDocument(Document&);
101 101
102 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 102 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
103 // https://bugs.webkit.org/show_bug.cgi?id=108890 103 // https://bugs.webkit.org/show_bug.cgi?id=108890
104 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet>>&); 104 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet>>&);
105 void resetAuthorStyle(TreeScope&); 105 void resetAuthorStyle(TreeScope&);
106 void resetRuleFeatures();
106 void finishAppendAuthorStyleSheets(); 107 void finishAppendAuthorStyleSheets();
107 108
108 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R efPtrWillBeMember<CSSStyleSheet>>&); 109 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R efPtrWillBeMember<CSSStyleSheet>>&);
109 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe r<CSSStyleSheet>>&); 110 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe r<CSSStyleSheet>>&);
110 void appendPendingAuthorStyleSheets(); 111 void appendPendingAuthorStyleSheets();
111 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; } 112 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; }
112 113
113 // TODO(esprehn): StyleResolver should probably not contain tree walking 114 // TODO(esprehn): StyleResolver should probably not contain tree walking
114 // state, instead we should pass a context object during recalcStyle. 115 // state, instead we should pass a context object during recalcStyle.
115 SelectorFilter& selectorFilter() { return m_selectorFilter; } 116 SelectorFilter& selectorFilter() { return m_selectorFilter; }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void clearStyleSharingList(); 168 void clearStyleSharingList();
168 169
169 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } 170 void increaseStyleSharingDepth() { ++m_styleSharingDepth; }
170 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } 171 void decreaseStyleSharingDepth() { --m_styleSharingDepth; }
171 172
172 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElementIfNeeded(Element& p arent, PseudoId); 173 PassRefPtrWillBeRawPtr<PseudoElement> createPseudoElementIfNeeded(Element& p arent, PseudoId);
173 174
174 DECLARE_TRACE(); 175 DECLARE_TRACE();
175 176
176 void addTreeBoundaryCrossingScope(ContainerNode& scope); 177 void addTreeBoundaryCrossingScope(ContainerNode& scope);
178 void initWatchedSelectorRules();
177 179
178 private: 180 private:
179 explicit StyleResolver(Document&); 181 explicit StyleResolver(Document&);
180 182
181 PassRefPtr<ComputedStyle> initialStyleForElement(); 183 PassRefPtr<ComputedStyle> initialStyleForElement();
182 184
183 void initWatchedSelectorRules();
184
185 // FIXME: This should probably go away, folded into FontBuilder. 185 // FIXME: This should probably go away, folded into FontBuilder.
186 void updateFont(StyleResolverState&); 186 void updateFont(StyleResolverState&);
187 187
188 void loadPendingResources(StyleResolverState&); 188 void loadPendingResources(StyleResolverState&);
189 void adjustComputedStyle(StyleResolverState&, Element*); 189 void adjustComputedStyle(StyleResolverState&, Element*);
190 190
191 void appendCSSStyleSheet(CSSStyleSheet&); 191 void appendCSSStyleSheet(CSSStyleSheet&);
192 192
193 void collectPseudoRulesForElement(const Element&, ElementRuleCollector&, Pse udoId, unsigned rulesToInclude); 193 void collectPseudoRulesForElement(const Element&, ElementRuleCollector&, Pse udoId, unsigned rulesToInclude);
194 void matchRuleSet(ElementRuleCollector&, RuleSet*); 194 void matchRuleSet(ElementRuleCollector&, RuleSet*);
195 void matchUARules(ElementRuleCollector&); 195 void matchUARules(ElementRuleCollector&);
196 void matchAuthorRules(const Element&, ElementRuleCollector&); 196 void matchAuthorRules(const Element&, ElementRuleCollector&);
197 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties); 197 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties);
198 void collectFeatures(); 198 void collectFeatures();
199 void collectTreeBoundaryCrossingRules(const Element&, ElementRuleCollector&) ; 199 void collectTreeBoundaryCrossingRules(const Element&, ElementRuleCollector&) ;
200 void resetRuleFeatures();
201 200
202 void applyMatchedProperties(StyleResolverState&, const MatchResult&); 201 void applyMatchedProperties(StyleResolverState&, const MatchResult&);
203 bool applyAnimatedProperties(StyleResolverState&, const Element* animatingEl ement); 202 bool applyAnimatedProperties(StyleResolverState&, const Element* animatingEl ement);
204 void applyCallbackSelectors(StyleResolverState&); 203 void applyCallbackSelectors(StyleResolverState&);
205 204
206 template <CSSPropertyPriority priority> 205 template <CSSPropertyPriority priority>
207 void applyMatchedProperties(StyleResolverState&, const MatchedPropertiesRang e&, bool important, bool inheritedOnly); 206 void applyMatchedProperties(StyleResolverState&, const MatchedPropertiesRang e&, bool important, bool inheritedOnly);
208 template <CSSPropertyPriority priority> 207 template <CSSPropertyPriority priority>
209 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelis tNone); 208 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelis tNone);
210 template <CSSPropertyPriority priority> 209 template <CSSPropertyPriority priority>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 bool m_needCollectFeatures; 248 bool m_needCollectFeatures;
250 bool m_printMediaType; 249 bool m_printMediaType;
251 250
252 unsigned m_styleSharingDepth; 251 unsigned m_styleSharingDepth;
253 WillBeHeapVector<OwnPtrWillBeMember<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists; 252 WillBeHeapVector<OwnPtrWillBeMember<StyleSharingList>, styleSharingMaxDepth> m_styleSharingLists;
254 }; 253 };
255 254
256 } // namespace blink 255 } // namespace blink
257 256
258 #endif // StyleResolver_h 257 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698