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

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

Issue 2534863002: Introduce markAllTreeScopesDirty. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 CSSStyleSheet& ensureInspectorStyleSheet(); 117 CSSStyleSheet& ensureInspectorStyleSheet();
118 RuleSet* watchedSelectorsRuleSet() { 118 RuleSet* watchedSelectorsRuleSet() {
119 return m_globalRuleSet.watchedSelectorsRuleSet(); 119 return m_globalRuleSet.watchedSelectorsRuleSet();
120 } 120 }
121 121
122 RuleSet* ruleSetForSheet(CSSStyleSheet&); 122 RuleSet* ruleSetForSheet(CSSStyleSheet&);
123 void mediaQueryAffectingValueChanged(); 123 void mediaQueryAffectingValueChanged();
124 void updateStyleSheetsInImport(DocumentStyleSheetCollector& parentCollector); 124 void updateStyleSheetsInImport(DocumentStyleSheetCollector& parentCollector);
125 void updateActiveStyleSheets(StyleResolverUpdateMode); 125 void updateActiveStyleSheets(StyleResolverUpdateMode);
126 void updateActiveStyle(); 126 void updateActiveStyle();
127 void markAllTreeScopesDirty() { m_allTreeScopesDirty = true; }
127 128
128 enum ActiveSheetsUpdate { DontUpdateActiveSheets, UpdateActiveSheets }; 129 enum ActiveSheetsUpdate { DontUpdateActiveSheets, UpdateActiveSheets };
129 String preferredStylesheetSetName() const { 130 String preferredStylesheetSetName() const {
130 return m_preferredStylesheetSetName; 131 return m_preferredStylesheetSetName;
131 } 132 }
132 String selectedStylesheetSetName() const { 133 String selectedStylesheetSetName() const {
133 return m_selectedStylesheetSetName; 134 return m_selectedStylesheetSetName;
134 } 135 }
135 void setPreferredStylesheetSetNameIfNotSet(const String&, ActiveSheetsUpdate); 136 void setPreferredStylesheetSetNameIfNotSet(const String&, ActiveSheetsUpdate);
136 void setSelectedStylesheetSetName(const String&); 137 void setSelectedStylesheetSetName(const String&);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 267
267 DECLARE_VIRTUAL_TRACE(); 268 DECLARE_VIRTUAL_TRACE();
268 DECLARE_TRACE_WRAPPERS(); 269 DECLARE_TRACE_WRAPPERS();
269 270
270 private: 271 private:
271 // CSSFontSelectorClient implementation. 272 // CSSFontSelectorClient implementation.
272 void fontsNeedUpdate(CSSFontSelector*) override; 273 void fontsNeedUpdate(CSSFontSelector*) override;
273 274
274 private: 275 private:
275 StyleEngine(Document&); 276 StyleEngine(Document&);
277 bool needsActiveStyleSheetUpdate() const {
278 return m_allTreeScopesDirty || m_documentScopeDirty ||
279 m_dirtyTreeScopes.size();
280 }
276 281
277 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); 282 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&);
278 TreeScopeStyleSheetCollection* styleSheetCollectionFor(TreeScope&); 283 TreeScopeStyleSheetCollection* styleSheetCollectionFor(TreeScope&);
279 bool shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMode) const; 284 bool shouldUpdateDocumentStyleSheetCollection() const;
280 bool shouldUpdateShadowTreeStyleSheetCollection( 285 bool shouldUpdateShadowTreeStyleSheetCollection() const;
281 StyleResolverUpdateMode) const;
282 286
283 void markDocumentDirty(); 287 void markDocumentDirty();
284 void markTreeScopeDirty(TreeScope&); 288 void markTreeScopeDirty(TreeScope&);
285 289
286 bool isMaster() const { return m_isMaster; } 290 bool isMaster() const { return m_isMaster; }
287 Document* master(); 291 Document* master();
288 Document& document() const { return *m_document; } 292 Document& document() const { return *m_document; }
289 293
290 typedef HeapHashSet<Member<TreeScope>> UnorderedTreeScopeSet; 294 typedef HeapHashSet<Member<TreeScope>> UnorderedTreeScopeSet;
291 295
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 m_documentStyleSheetCollection; 348 m_documentStyleSheetCollection;
345 349
346 Member<StyleRuleUsageTracker> m_tracker; 350 Member<StyleRuleUsageTracker> m_tracker;
347 351
348 typedef HeapHashMap<WeakMember<TreeScope>, 352 typedef HeapHashMap<WeakMember<TreeScope>,
349 Member<ShadowTreeStyleSheetCollection>> 353 Member<ShadowTreeStyleSheetCollection>>
350 StyleSheetCollectionMap; 354 StyleSheetCollectionMap;
351 StyleSheetCollectionMap m_styleSheetCollectionMap; 355 StyleSheetCollectionMap m_styleSheetCollectionMap;
352 356
353 bool m_documentScopeDirty = true; 357 bool m_documentScopeDirty = true;
358 bool m_allTreeScopesDirty = false;
354 UnorderedTreeScopeSet m_dirtyTreeScopes; 359 UnorderedTreeScopeSet m_dirtyTreeScopes;
355 UnorderedTreeScopeSet m_activeTreeScopes; 360 UnorderedTreeScopeSet m_activeTreeScopes;
356 DocumentOrderedList m_treeBoundaryCrossingScopes; 361 DocumentOrderedList m_treeBoundaryCrossingScopes;
357 362
358 String m_preferredStylesheetSetName; 363 String m_preferredStylesheetSetName;
359 String m_selectedStylesheetSetName; 364 String m_selectedStylesheetSetName;
360 365
361 CSSGlobalRuleSet m_globalRuleSet; 366 CSSGlobalRuleSet m_globalRuleSet;
362 367
363 bool m_usesRemUnits = false; 368 bool m_usesRemUnits = false;
(...skipping 12 matching lines...) Expand all
376 381
377 std::unique_ptr<StyleResolverStats> m_styleResolverStats; 382 std::unique_ptr<StyleResolverStats> m_styleResolverStats;
378 unsigned m_styleForElementCount = 0; 383 unsigned m_styleForElementCount = 0;
379 384
380 friend class StyleEngineTest; 385 friend class StyleEngineTest;
381 }; 386 };
382 387
383 } // namespace blink 388 } // namespace blink
384 389
385 #endif 390 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698