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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.h

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: 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 19 matching lines...) Expand all
30 #ifndef StyleEngine_h 30 #ifndef StyleEngine_h
31 #define StyleEngine_h 31 #define StyleEngine_h
32 32
33 #include "bindings/core/v8/ScriptWrappable.h" 33 #include "bindings/core/v8/ScriptWrappable.h"
34 #include "bindings/core/v8/TraceWrapperMember.h" 34 #include "bindings/core/v8/TraceWrapperMember.h"
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/css/CSSFontSelectorClient.h" 36 #include "core/css/CSSFontSelectorClient.h"
37 #include "core/css/invalidation/StyleInvalidator.h" 37 #include "core/css/invalidation/StyleInvalidator.h"
38 #include "core/css/resolver/StyleResolver.h" 38 #include "core/css/resolver/StyleResolver.h"
39 #include "core/css/resolver/StyleResolverStats.h" 39 #include "core/css/resolver/StyleResolverStats.h"
40 #include "core/css/resolver/StyleRuleUsageTracker.h"
caseq 2016/10/27 20:59:55 forward-declare instead.
valih 2016/10/27 21:41:16 Done.
40 #include "core/dom/Document.h" 41 #include "core/dom/Document.h"
41 #include "core/dom/DocumentOrderedList.h" 42 #include "core/dom/DocumentOrderedList.h"
42 #include "core/dom/DocumentStyleSheetCollection.h" 43 #include "core/dom/DocumentStyleSheetCollection.h"
43 #include "core/dom/StyleEngineContext.h" 44 #include "core/dom/StyleEngineContext.h"
44 #include "platform/heap/Handle.h" 45 #include "platform/heap/Handle.h"
45 #include "wtf/Allocator.h" 46 #include "wtf/Allocator.h"
46 #include "wtf/AutoReset.h" 47 #include "wtf/AutoReset.h"
47 #include "wtf/ListHashSet.h" 48 #include "wtf/ListHashSet.h"
48 #include "wtf/Vector.h" 49 #include "wtf/Vector.h"
49 #include "wtf/text/WTFString.h" 50 #include "wtf/text/WTFString.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 159
159 void didRemoveShadowRoot(ShadowRoot*); 160 void didRemoveShadowRoot(ShadowRoot*);
160 void shadowRootRemovedFromDocument(ShadowRoot*); 161 void shadowRootRemovedFromDocument(ShadowRoot*);
161 void appendActiveAuthorStyleSheets(); 162 void appendActiveAuthorStyleSheets();
162 void addTreeBoundaryCrossingScope(const TreeScope&); 163 void addTreeBoundaryCrossingScope(const TreeScope&);
163 const DocumentOrderedList& treeBoundaryCrossingScopes() const { 164 const DocumentOrderedList& treeBoundaryCrossingScopes() const {
164 return m_treeBoundaryCrossingScopes; 165 return m_treeBoundaryCrossingScopes;
165 } 166 }
166 void resetAuthorStyle(TreeScope&); 167 void resetAuthorStyle(TreeScope&);
167 168
169 void setRuleUsageTracker(Member<StyleRuleUsageTracker>);
caseq 2016/10/27 20:59:55 StyleRuleUsageTracker*, drop Member<>
valih 2016/10/27 21:41:16 Done.
170
168 StyleResolver* resolver() const { return m_resolver.get(); } 171 StyleResolver* resolver() const { return m_resolver.get(); }
169 172
170 StyleResolver& ensureResolver() { 173 StyleResolver& ensureResolver() {
171 if (!m_resolver) { 174 if (!m_resolver) {
172 createResolver(); 175 createResolver();
173 } else if (m_resolver->hasPendingAuthorStyleSheets()) { 176 } else if (m_resolver->hasPendingAuthorStyleSheets()) {
174 viewportRulesChanged(); 177 viewportRulesChanged();
175 m_resolver->appendPendingAuthorStyleSheets(); 178 m_resolver->appendPendingAuthorStyleSheets();
176 } 179 }
177 return *m_resolver.get(); 180 return *m_resolver.get();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // Track the number of currently loading top-level stylesheets needed for 295 // Track the number of currently loading top-level stylesheets needed for
293 // layout. Sheets loaded using the @import directive are not included in this 296 // layout. Sheets loaded using the @import directive are not included in this
294 // count. We use this count of pending sheets to detect when we can begin 297 // count. We use this count of pending sheets to detect when we can begin
295 // attaching elements and when it is safe to execute scripts. 298 // attaching elements and when it is safe to execute scripts.
296 int m_pendingScriptBlockingStylesheets = 0; 299 int m_pendingScriptBlockingStylesheets = 0;
297 int m_pendingRenderBlockingStylesheets = 0; 300 int m_pendingRenderBlockingStylesheets = 0;
298 301
299 HeapVector<Member<CSSStyleSheet>> m_injectedAuthorStyleSheets; 302 HeapVector<Member<CSSStyleSheet>> m_injectedAuthorStyleSheets;
300 Member<CSSStyleSheet> m_inspectorStyleSheet; 303 Member<CSSStyleSheet> m_inspectorStyleSheet;
301 304
305 Member<StyleRuleUsageTracker> m_tracker;
306
302 Member<DocumentStyleSheetCollection> m_documentStyleSheetCollection; 307 Member<DocumentStyleSheetCollection> m_documentStyleSheetCollection;
303 308
304 typedef HeapHashMap<WeakMember<TreeScope>, 309 typedef HeapHashMap<WeakMember<TreeScope>,
305 Member<ShadowTreeStyleSheetCollection>> 310 Member<ShadowTreeStyleSheetCollection>>
306 StyleSheetCollectionMap; 311 StyleSheetCollectionMap;
307 StyleSheetCollectionMap m_styleSheetCollectionMap; 312 StyleSheetCollectionMap m_styleSheetCollectionMap;
308 313
309 bool m_documentScopeDirty = true; 314 bool m_documentScopeDirty = true;
310 UnorderedTreeScopeSet m_dirtyTreeScopes; 315 UnorderedTreeScopeSet m_dirtyTreeScopes;
311 UnorderedTreeScopeSet m_activeTreeScopes; 316 UnorderedTreeScopeSet m_activeTreeScopes;
(...skipping 22 matching lines...) Expand all
334 339
335 std::unique_ptr<StyleResolverStats> m_styleResolverStats; 340 std::unique_ptr<StyleResolverStats> m_styleResolverStats;
336 unsigned m_styleForElementCount = 0; 341 unsigned m_styleForElementCount = 0;
337 342
338 friend class StyleEngineTest; 343 friend class StyleEngineTest;
339 }; 344 };
340 345
341 } // namespace blink 346 } // namespace blink
342 347
343 #endif 348 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698