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

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

Issue 1493323002: Renamed authorStyleSheets to injectedAuthorStyleSheets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 { 83 {
84 return isHTMLStyleElement(node) || isSVGStyleElement(node); 84 return isHTMLStyleElement(node) || isSVGStyleElement(node);
85 } 85 }
86 86
87 #if !ENABLE(OILPAN) 87 #if !ENABLE(OILPAN)
88 void StyleEngine::detachFromDocument() 88 void StyleEngine::detachFromDocument()
89 { 89 {
90 // Cleanup is performed eagerly when the StyleEngine is removed from the 90 // Cleanup is performed eagerly when the StyleEngine is removed from the
91 // document. The StyleEngine is unreachable after this, since only the 91 // document. The StyleEngine is unreachable after this, since only the
92 // document has a reference to it. 92 // document has a reference to it.
93 for (unsigned i = 0; i < m_authorStyleSheets.size(); ++i) 93 for (unsigned i = 0; i < m_injectedAuthorStyleSheets.size(); ++i)
94 m_authorStyleSheets[i]->clearOwnerNode(); 94 m_injectedAuthorStyleSheets[i]->clearOwnerNode();
95 95
96 if (m_fontSelector) { 96 if (m_fontSelector) {
97 m_fontSelector->clearDocument(); 97 m_fontSelector->clearDocument();
98 m_fontSelector->unregisterForInvalidationCallbacks(this); 98 m_fontSelector->unregisterForInvalidationCallbacks(this);
99 } 99 }
100 100
101 // Decrement reference counts for things we could be keeping alive. 101 // Decrement reference counts for things we could be keeping alive.
102 m_fontSelector.clear(); 102 m_fontSelector.clear();
103 m_resolver.clear(); 103 m_resolver.clear();
104 m_styleSheetCollectionMap.clear(); 104 m_styleSheetCollectionMap.clear();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 void StyleEngine::resetCSSFeatureFlags(const RuleFeatureSet& features) 163 void StyleEngine::resetCSSFeatureFlags(const RuleFeatureSet& features)
164 { 164 {
165 m_usesSiblingRules = features.usesSiblingRules(); 165 m_usesSiblingRules = features.usesSiblingRules();
166 m_usesFirstLineRules = features.usesFirstLineRules(); 166 m_usesFirstLineRules = features.usesFirstLineRules();
167 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector(); 167 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector();
168 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors(); 168 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors();
169 } 169 }
170 170
171 void StyleEngine::addAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> auth orSheet) 171 void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a uthorSheet)
172 { 172 {
173 m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document)); 173 m_injectedAuthorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_docu ment));
174 document().addedStyleSheet(m_authorStyleSheets.last().get()); 174 document().addedStyleSheet(m_injectedAuthorStyleSheets.last().get());
175 markDocumentDirty(); 175 markDocumentDirty();
176 } 176 }
177 177
178 void StyleEngine::addPendingSheet() 178 void StyleEngine::addPendingSheet()
179 { 179 {
180 m_pendingStylesheets++; 180 m_pendingStylesheets++;
181 } 181 }
182 182
183 // This method is called whenever a top-level stylesheet has finished loading. 183 // This method is called whenever a top-level stylesheet has finished loading.
184 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) 184 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode)
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 ASSERT(isMaster()); 709 ASSERT(isMaster());
710 InvalidationLists invalidationLists; 710 InvalidationLists invalidationLists;
711 ensureResolver().ensureUpdatedRuleFeatureSet().collectInvalidationSetsForPse udoClass(invalidationLists, element, pseudoType); 711 ensureResolver().ensureUpdatedRuleFeatureSet().collectInvalidationSetsForPse udoClass(invalidationLists, element, pseudoType);
712 m_styleInvalidator.scheduleInvalidationSetsForElement(invalidationLists, ele ment); 712 m_styleInvalidator.scheduleInvalidationSetsForElement(invalidationLists, ele ment);
713 } 713 }
714 714
715 DEFINE_TRACE(StyleEngine) 715 DEFINE_TRACE(StyleEngine)
716 { 716 {
717 #if ENABLE(OILPAN) 717 #if ENABLE(OILPAN)
718 visitor->trace(m_document); 718 visitor->trace(m_document);
719 visitor->trace(m_authorStyleSheets); 719 visitor->trace(m_injectedAuthorStyleSheets);
720 visitor->trace(m_documentStyleSheetCollection); 720 visitor->trace(m_documentStyleSheetCollection);
721 visitor->trace(m_styleSheetCollectionMap); 721 visitor->trace(m_styleSheetCollectionMap);
722 visitor->trace(m_resolver); 722 visitor->trace(m_resolver);
723 visitor->trace(m_styleInvalidator); 723 visitor->trace(m_styleInvalidator);
724 visitor->trace(m_dirtyTreeScopes); 724 visitor->trace(m_dirtyTreeScopes);
725 visitor->trace(m_activeTreeScopes); 725 visitor->trace(m_activeTreeScopes);
726 visitor->trace(m_fontSelector); 726 visitor->trace(m_fontSelector);
727 visitor->trace(m_textToSheetCache); 727 visitor->trace(m_textToSheetCache);
728 visitor->trace(m_sheetToTextCache); 728 visitor->trace(m_sheetToTextCache);
729 #endif 729 #endif
730 CSSFontSelectorClient::trace(visitor); 730 CSSFontSelectorClient::trace(visitor);
731 } 731 }
732 732
733 } 733 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698