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

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

Issue 2766373002: Notify inspector of stylesheet changes when removing tree scopes. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | no next file » | 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, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 for (TreeScope* treeScope : treeScopesRemoved) 339 for (TreeScope* treeScope : treeScopesRemoved)
340 m_activeTreeScopes.erase(treeScope); 340 m_activeTreeScopes.erase(treeScope);
341 } 341 }
342 342
343 probe::activeStyleSheetsUpdated(m_document); 343 probe::activeStyleSheetsUpdated(m_document);
344 344
345 m_dirtyTreeScopes.clear(); 345 m_dirtyTreeScopes.clear();
346 m_documentScopeDirty = false; 346 m_documentScopeDirty = false;
347 m_allTreeScopesDirty = false; 347 m_allTreeScopesDirty = false;
348 m_treeScopesRemoved = false;
348 } 349 }
349 350
350 void StyleEngine::updateViewport() { 351 void StyleEngine::updateViewport() {
351 if (m_viewportResolver) 352 if (m_viewportResolver)
352 m_viewportResolver->updateViewport(documentStyleSheetCollection()); 353 m_viewportResolver->updateViewport(documentStyleSheetCollection());
353 } 354 }
354 355
355 bool StyleEngine::needsActiveStyleUpdate() const { 356 bool StyleEngine::needsActiveStyleUpdate() const {
356 return (m_viewportResolver && m_viewportResolver->needsUpdate()) || 357 return (m_viewportResolver && m_viewportResolver->needsUpdate()) ||
357 needsActiveStyleSheetUpdate() || m_globalRuleSet.isDirty(); 358 needsActiveStyleSheetUpdate() || m_globalRuleSet.isDirty();
(...skipping 26 matching lines...) Expand all
384 // FIXME: Inspector needs a vector which has all active stylesheets. 385 // FIXME: Inspector needs a vector which has all active stylesheets.
385 // However, creating such a large vector might cause performance regression. 386 // However, creating such a large vector might cause performance regression.
386 // Need to implement some smarter solution. 387 // Need to implement some smarter solution.
387 return activeStyleSheets; 388 return activeStyleSheets;
388 } 389 }
389 390
390 void StyleEngine::shadowRootRemovedFromDocument(ShadowRoot* shadowRoot) { 391 void StyleEngine::shadowRootRemovedFromDocument(ShadowRoot* shadowRoot) {
391 m_styleSheetCollectionMap.erase(shadowRoot); 392 m_styleSheetCollectionMap.erase(shadowRoot);
392 m_activeTreeScopes.erase(shadowRoot); 393 m_activeTreeScopes.erase(shadowRoot);
393 m_dirtyTreeScopes.erase(shadowRoot); 394 m_dirtyTreeScopes.erase(shadowRoot);
395 m_treeScopesRemoved = true;
394 resetAuthorStyle(*shadowRoot); 396 resetAuthorStyle(*shadowRoot);
395 } 397 }
396 398
397 void StyleEngine::addTreeBoundaryCrossingScope(const TreeScope& treeScope) { 399 void StyleEngine::addTreeBoundaryCrossingScope(const TreeScope& treeScope) {
398 m_treeBoundaryCrossingScopes.add(&treeScope.rootNode()); 400 m_treeBoundaryCrossingScopes.add(&treeScope.rootNode());
399 } 401 }
400 402
401 void StyleEngine::resetAuthorStyle(TreeScope& treeScope) { 403 void StyleEngine::resetAuthorStyle(TreeScope& treeScope) {
402 m_treeBoundaryCrossingScopes.remove(&treeScope.rootNode()); 404 m_treeBoundaryCrossingScopes.remove(&treeScope.rootNode());
403 405
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 } 1155 }
1154 1156
1155 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1157 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1156 for (auto sheet : m_injectedAuthorStyleSheets) { 1158 for (auto sheet : m_injectedAuthorStyleSheets) {
1157 visitor->traceWrappers(sheet); 1159 visitor->traceWrappers(sheet);
1158 } 1160 }
1159 visitor->traceWrappers(m_documentStyleSheetCollection); 1161 visitor->traceWrappers(m_documentStyleSheetCollection);
1160 } 1162 }
1161 1163
1162 } // namespace blink 1164 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698