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

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

Issue 143463011: [import] support document.stylesheets in imported documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 years, 11 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/DocumentStyleSheetCollector.h ('k') | Source/core/dom/StyleEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentStyleSheetCollector.cpp
diff --git a/Source/core/dom/DocumentStyleSheetCollector.cpp b/Source/core/dom/DocumentStyleSheetCollector.cpp
index a25d824dd4decd270d4931135a38af142cb93a4d..b2bb946cbe11353811f58dc230bf9d27b9dba2ea 100644
--- a/Source/core/dom/DocumentStyleSheetCollector.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollector.cpp
@@ -27,18 +27,45 @@
#include "config.h"
#include "core/dom/DocumentStyleSheetCollector.h"
-#include "core/dom/Document.h"
+#include "core/css/CSSStyleSheet.h"
+#include "core/css/StyleSheet.h"
+#include "core/dom/DocumentStyleSheetCollection.h"
namespace WebCore {
-bool DocumentStyleSheetCollector::isCollectingForList(TreeScope& scope) const
+DocumentStyleSheetCollector::DocumentStyleSheetCollector(Vector<RefPtr<StyleSheet> >& sheetsForList, Vector<RefPtr<CSSStyleSheet> >& activeList)
+ : m_styleSheetsForStyleSheetList(sheetsForList)
+ , m_activeAuthorStyleSheets(activeList)
{
- return m_root == scope;
}
-void DocumentStyleSheetCollector::setCollectionTo(StyleSheetCollectionBase& collection)
+DocumentStyleSheetCollector::~DocumentStyleSheetCollector()
+{
+}
+
+void DocumentStyleSheetCollector::appendActiveStyleSheets(const Vector<RefPtr<CSSStyleSheet> >& sheets)
+{
+ m_activeAuthorStyleSheets.append(sheets);
+}
+
+void DocumentStyleSheetCollector::appendActiveStyleSheet(CSSStyleSheet* sheet)
+{
+ m_activeAuthorStyleSheets.append(sheet);
+}
+
+void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet)
+{
+ m_styleSheetsForStyleSheetList.append(sheet);
+}
+
+ActiveDocumentStyleSheetCollector::ActiveDocumentStyleSheetCollector(StyleSheetCollectionBase& collection)
+ : DocumentStyleSheetCollector(collection.m_styleSheetsForStyleSheetList, collection.m_activeAuthorStyleSheets)
+{
+}
+
+ImportedDocumentStyleSheetCollector::ImportedDocumentStyleSheetCollector(DocumentStyleSheetCollector& collector, Vector<RefPtr<StyleSheet> >& sheetForList)
+ : DocumentStyleSheetCollector(sheetForList, collector.m_activeAuthorStyleSheets)
{
- m_collection.swap(collection);
}
}
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollector.h ('k') | Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698