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

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

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: Backend for CSS Rule tracking. Created 4 years, 1 month 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. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class CSSRuleList; 49 class CSSRuleList;
50 class CSSStyleSheet; 50 class CSSStyleSheet;
51 class CSSValue; 51 class CSSValue;
52 class Document; 52 class Document;
53 class Element; 53 class Element;
54 class Interpolation; 54 class Interpolation;
55 class MatchResult; 55 class MatchResult;
56 class MediaQueryEvaluator; 56 class MediaQueryEvaluator;
57 class StylePropertySet; 57 class StylePropertySet;
58 class StyleRule; 58 class StyleRule;
59 class StyleRuleUsageTracker;
59 60
60 enum StyleSharingBehavior { 61 enum StyleSharingBehavior {
61 AllowStyleSharing, 62 AllowStyleSharing,
62 DisallowStyleSharing, 63 DisallowStyleSharing,
63 }; 64 };
64 65
65 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; 66 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL };
66 67
67 const unsigned styleSharingListSize = 15; 68 const unsigned styleSharingListSize = 15;
68 const unsigned styleSharingMaxDepth = 32; 69 const unsigned styleSharingMaxDepth = 32;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void addToStyleSharingList(Element&); 171 void addToStyleSharingList(Element&);
171 void clearStyleSharingList(); 172 void clearStyleSharingList();
172 173
173 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } 174 void increaseStyleSharingDepth() { ++m_styleSharingDepth; }
174 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } 175 void decreaseStyleSharingDepth() { --m_styleSharingDepth; }
175 176
176 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId); 177 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId);
177 178
178 DECLARE_TRACE(); 179 DECLARE_TRACE();
179 180
181 void setRuleUsageTracker(StyleRuleUsageTracker*);
182
180 private: 183 private:
181 explicit StyleResolver(Document&); 184 explicit StyleResolver(Document&);
182 185
183 PassRefPtr<ComputedStyle> initialStyleForElement(); 186 PassRefPtr<ComputedStyle> initialStyleForElement();
184 187
185 // FIXME: This should probably go away, folded into FontBuilder. 188 // FIXME: This should probably go away, folded into FontBuilder.
186 void updateFont(StyleResolverState&); 189 void updateFont(StyleResolverState&);
187 190
191 void addMatchedRulesToTracker(const ElementRuleCollector&);
192
188 void loadPendingResources(StyleResolverState&); 193 void loadPendingResources(StyleResolverState&);
189 void adjustComputedStyle(StyleResolverState&, Element*); 194 void adjustComputedStyle(StyleResolverState&, Element*);
190 195
191 void appendCSSStyleSheet(CSSStyleSheet&); 196 void appendCSSStyleSheet(CSSStyleSheet&);
192 197
193 void collectPseudoRulesForElement(const Element&, 198 void collectPseudoRulesForElement(const Element&,
194 ElementRuleCollector&, 199 ElementRuleCollector&,
195 PseudoId, 200 PseudoId,
196 unsigned rulesToInclude); 201 unsigned rulesToInclude);
197 void matchRuleSet(ElementRuleCollector&, RuleSet*); 202 void matchRuleSet(ElementRuleCollector&, RuleSet*);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 286
282 Member<MediaQueryEvaluator> m_medium; 287 Member<MediaQueryEvaluator> m_medium;
283 MediaQueryResultList m_viewportDependentMediaQueryResults; 288 MediaQueryResultList m_viewportDependentMediaQueryResults;
284 MediaQueryResultList m_deviceDependentMediaQueryResults; 289 MediaQueryResultList m_deviceDependentMediaQueryResults;
285 290
286 Member<Document> m_document; 291 Member<Document> m_document;
287 SelectorFilter m_selectorFilter; 292 SelectorFilter m_selectorFilter;
288 293
289 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; 294 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets;
290 295
296 Member<StyleRuleUsageTracker> m_tracker;
297
291 bool m_printMediaType; 298 bool m_printMediaType;
292 299
293 unsigned m_styleSharingDepth; 300 unsigned m_styleSharingDepth;
294 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> 301 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth>
295 m_styleSharingLists; 302 m_styleSharingLists;
296 }; 303 };
297 304
298 } // namespace blink 305 } // namespace blink
299 306
300 #endif // StyleResolver_h 307 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698