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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include <memory> 51 #include <memory>
52 52
53 namespace blink { 53 namespace blink {
54 54
55 class CSSFontSelector; 55 class CSSFontSelector;
56 class CSSStyleSheet; 56 class CSSStyleSheet;
57 class Node; 57 class Node;
58 class RuleFeatureSet; 58 class RuleFeatureSet;
59 class ShadowTreeStyleSheetCollection; 59 class ShadowTreeStyleSheetCollection;
60 class StyleRuleFontFace; 60 class StyleRuleFontFace;
61 class StyleRuleUsageTracker;
61 class StyleSheet; 62 class StyleSheet;
62 class StyleSheetContents; 63 class StyleSheetContents;
63 class ViewportStyleResolver; 64 class ViewportStyleResolver;
64 65
65 class CORE_EXPORT StyleEngine final 66 class CORE_EXPORT StyleEngine final
66 : public GarbageCollectedFinalized<StyleEngine>, 67 : public GarbageCollectedFinalized<StyleEngine>,
67 public CSSFontSelectorClient, 68 public CSSFontSelectorClient,
68 public TraceWrapperBase { 69 public TraceWrapperBase {
69 USING_GARBAGE_COLLECTED_MIXIN(StyleEngine); 70 USING_GARBAGE_COLLECTED_MIXIN(StyleEngine);
70 71
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 166
166 void shadowRootRemovedFromDocument(ShadowRoot*); 167 void shadowRootRemovedFromDocument(ShadowRoot*);
167 void addTreeBoundaryCrossingScope(const TreeScope&); 168 void addTreeBoundaryCrossingScope(const TreeScope&);
168 const DocumentOrderedList& treeBoundaryCrossingScopes() const { 169 const DocumentOrderedList& treeBoundaryCrossingScopes() const {
169 return m_treeBoundaryCrossingScopes; 170 return m_treeBoundaryCrossingScopes;
170 } 171 }
171 void resetAuthorStyle(TreeScope&); 172 void resetAuthorStyle(TreeScope&);
172 173
173 StyleResolver* resolver() const { return m_resolver; } 174 StyleResolver* resolver() const { return m_resolver; }
174 175
176 void setRuleUsageTracker(StyleRuleUsageTracker*);
177
175 StyleResolver& ensureResolver() { 178 StyleResolver& ensureResolver() {
176 if (!m_resolver) { 179 if (!m_resolver) {
177 createResolver(); 180 createResolver();
178 } else if (m_resolver->hasPendingAuthorStyleSheets()) { 181 } else if (m_resolver->hasPendingAuthorStyleSheets()) {
179 viewportRulesChanged(); 182 viewportRulesChanged();
180 m_resolver->appendPendingAuthorStyleSheets(); 183 m_resolver->appendPendingAuthorStyleSheets();
181 finishAppendAuthorStyleSheets(); 184 finishAppendAuthorStyleSheets();
182 } else if (m_globalRuleSet.isDirty()) { 185 } else if (m_globalRuleSet.isDirty()) {
183 m_globalRuleSet.update(document()); 186 m_globalRuleSet.update(document());
184 } 187 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // attaching elements and when it is safe to execute scripts. 315 // attaching elements and when it is safe to execute scripts.
313 int m_pendingScriptBlockingStylesheets = 0; 316 int m_pendingScriptBlockingStylesheets = 0;
314 int m_pendingRenderBlockingStylesheets = 0; 317 int m_pendingRenderBlockingStylesheets = 0;
315 318
316 HeapVector<TraceWrapperMember<CSSStyleSheet>> m_injectedAuthorStyleSheets; 319 HeapVector<TraceWrapperMember<CSSStyleSheet>> m_injectedAuthorStyleSheets;
317 Member<CSSStyleSheet> m_inspectorStyleSheet; 320 Member<CSSStyleSheet> m_inspectorStyleSheet;
318 321
319 TraceWrapperMember<DocumentStyleSheetCollection> 322 TraceWrapperMember<DocumentStyleSheetCollection>
320 m_documentStyleSheetCollection; 323 m_documentStyleSheetCollection;
321 324
325 Member<StyleRuleUsageTracker> m_tracker;
326
322 typedef HeapHashMap<WeakMember<TreeScope>, 327 typedef HeapHashMap<WeakMember<TreeScope>,
323 Member<ShadowTreeStyleSheetCollection>> 328 Member<ShadowTreeStyleSheetCollection>>
324 StyleSheetCollectionMap; 329 StyleSheetCollectionMap;
325 StyleSheetCollectionMap m_styleSheetCollectionMap; 330 StyleSheetCollectionMap m_styleSheetCollectionMap;
326 331
327 bool m_documentScopeDirty = true; 332 bool m_documentScopeDirty = true;
328 UnorderedTreeScopeSet m_dirtyTreeScopes; 333 UnorderedTreeScopeSet m_dirtyTreeScopes;
329 UnorderedTreeScopeSet m_activeTreeScopes; 334 UnorderedTreeScopeSet m_activeTreeScopes;
330 DocumentOrderedList m_treeBoundaryCrossingScopes; 335 DocumentOrderedList m_treeBoundaryCrossingScopes;
331 336
(...skipping 17 matching lines...) Expand all
349 354
350 std::unique_ptr<StyleResolverStats> m_styleResolverStats; 355 std::unique_ptr<StyleResolverStats> m_styleResolverStats;
351 unsigned m_styleForElementCount = 0; 356 unsigned m_styleForElementCount = 0;
352 357
353 friend class StyleEngineTest; 358 friend class StyleEngineTest;
354 }; 359 };
355 360
356 } // namespace blink 361 } // namespace blink
357 362
358 #endif 363 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698