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

Unified Diff: Source/core/dom/DocumentStyleSheetCollection.cpp

Issue 975933002: Return reference from styleEngine() accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollection.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentStyleSheetCollection.cpp
diff --git a/Source/core/dom/DocumentStyleSheetCollection.cpp b/Source/core/dom/DocumentStyleSheetCollection.cpp
index 89889154d5e4ab996a8f1525f7a811bb67d5bac1..49ae6b1532734ee1e43263481c1543918259a045 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -43,7 +43,7 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope)
ASSERT(treeScope.rootNode() == treeScope.rootNode().document());
}
-void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* engine, DocumentStyleSheetCollector& collector)
+void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine& engine, DocumentStyleSheetCollector& collector)
{
for (Node* n : m_styleSheetCandidateNodes) {
StyleSheetCandidate candidate(*n);
@@ -56,14 +56,14 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine*
if (collector.hasVisited(document))
continue;
collector.willVisit(document);
- document->styleEngine()->updateStyleSheetsInImport(collector);
+ document->styleEngine().updateStyleSheetsInImport(collector);
continue;
}
if (candidate.isEnabledAndLoading()) {
// it is loading but we should still decide which style sheet set to use
- if (candidate.hasPreferrableName(engine->preferredStylesheetSetName()))
- engine->selectStylesheetSetName(candidate.title());
+ if (candidate.hasPreferrableName(engine.preferredStylesheetSetName()))
+ engine.selectStylesheetSetName(candidate.title());
continue;
}
@@ -71,23 +71,23 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine*
if (!sheet)
continue;
- if (candidate.hasPreferrableName(engine->preferredStylesheetSetName()))
- engine->selectStylesheetSetName(candidate.title());
+ if (candidate.hasPreferrableName(engine.preferredStylesheetSetName()))
+ engine.selectStylesheetSetName(candidate.title());
collector.appendSheetForList(sheet);
- if (candidate.canBeActivated(engine->preferredStylesheetSetName()))
+ if (candidate.canBeActivated(engine.preferredStylesheetSetName()))
collector.appendActiveStyleSheet(toCSSStyleSheet(sheet));
}
}
-void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, DocumentStyleSheetCollector& collector)
+void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine& engine, DocumentStyleSheetCollector& collector)
{
- ASSERT(document().styleEngine() == engine);
- collector.appendActiveStyleSheets(engine->injectedAuthorStyleSheets());
- collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
+ ASSERT(&document().styleEngine() == &engine);
+ collector.appendActiveStyleSheets(engine.injectedAuthorStyleSheets());
+ collector.appendActiveStyleSheets(engine.documentAuthorStyleSheets());
collectStyleSheetsFromCandidates(engine, collector);
}
-void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
+void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine& engine, StyleResolverUpdateMode updateMode)
{
StyleSheetCollection collection;
ActiveDocumentStyleSheetCollector collector(collection);
@@ -97,15 +97,15 @@ void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine,
analyzeStyleSheetChange(updateMode, collection, change);
if (change.styleResolverUpdateType == Reconstruct) {
- engine->clearMasterResolver();
+ engine.clearMasterResolver();
// FIMXE: The following depends on whether StyleRuleFontFace was modified or not.
// No need to always-clear font cache.
- engine->clearFontCache();
- } else if (StyleResolver* styleResolver = engine->resolver()) {
+ engine.clearFontCache();
+ } else if (StyleResolver* styleResolver = engine.resolver()) {
if (change.styleResolverUpdateType != Additive) {
ASSERT(change.styleResolverUpdateType == Reset);
styleResolver->resetAuthorStyle(treeScope());
- engine->removeFontFaceRules(change.fontFaceRulesToRemove);
+ engine.removeFontFaceRules(change.fontFaceRulesToRemove);
styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets());
} else {
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollection.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698