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

Unified Diff: sky/engine/core/dom/DocumentStyleSheetCollection.cpp

Issue 803673003: Delete StyleSheetList and support code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/dom/DocumentStyleSheetCollection.cpp
diff --git a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
index 047dba27cd020782bd35d2a0f6a7f1b56a928dbe..f0ff039aa65a45657642e3b1e2033ceffdc436c4 100644
--- a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
+++ b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
@@ -30,9 +30,8 @@
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
#include "sky/engine/core/css/resolver/StyleResolver.h"
#include "sky/engine/core/dom/Document.h"
-#include "sky/engine/core/dom/DocumentStyleSheetCollector.h"
#include "sky/engine/core/dom/StyleEngine.h"
-#include "sky/engine/core/dom/StyleSheetCandidate.h"
+#include "sky/engine/core/html/HTMLStyleElement.h"
namespace blink {
@@ -42,36 +41,30 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope)
ASSERT(treeScope.rootNode() == treeScope.rootNode().document());
}
-void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* engine, DocumentStyleSheetCollector& collector)
+void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* engine, StyleSheetCollection& collection)
{
DocumentOrderedList::iterator begin = m_styleSheetCandidateNodes.begin();
DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end();
for (DocumentOrderedList::iterator it = begin; it != end; ++it) {
- Node* n = *it;
- StyleSheetCandidate candidate(*n);
-
- CSSStyleSheet* sheet = candidate.sheet();
- if (!sheet)
+ Node* node = *it;
+ if (!isHTMLStyleElement(*node))
ojan 2014/12/12 23:38:39 Nit: This could be an assert.
continue;
-
- collector.appendSheetForList(sheet);
- if (candidate.canBeActivated())
- collector.appendActiveStyleSheet(sheet);
+ if (CSSStyleSheet* sheet = toHTMLStyleElement(node)->sheet())
+ collection.appendActiveStyleSheet(sheet);
}
}
-void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, DocumentStyleSheetCollector& collector)
+void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, StyleSheetCollection& collection)
{
ASSERT(document().styleEngine() == engine);
- collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
- collectStyleSheetsFromCandidates(engine, collector);
+ collection.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
+ collectStyleSheetsFromCandidates(engine, collection);
}
void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine)
{
StyleSheetCollection collection;
- ActiveDocumentStyleSheetCollector collector(collection);
- collectStyleSheets(engine, collector);
+ collectStyleSheets(engine, collection);
engine->clearMasterResolver();
// FIMXE: The following depends on whether StyleRuleFontFace was modified or not.

Powered by Google App Engine
This is Rietveld 408576698