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

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: Rebased to ToT 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
Index: Source/core/dom/DocumentStyleSheetCollector.cpp
diff --git a/Source/core/dom/DocumentStyleSheetCollector.cpp b/Source/core/dom/DocumentStyleSheetCollector.cpp
index a25d824dd4decd270d4931135a38af142cb93a4d..286e8c70fa636e54397df1d981e52c9da44601cc 100644
--- a/Source/core/dom/DocumentStyleSheetCollector.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollector.cpp
@@ -27,18 +27,39 @@
#include "config.h"
#include "core/dom/DocumentStyleSheetCollector.h"
-#include "core/dom/Document.h"
+#include "core/css/CSSStyleSheet.h"
+#include "core/css/StyleSheet.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()
{
- m_collection.swap(collection);
+}
+
+DocumentStyleSheetCollector DocumentStyleSheetCollector::subcollectorWith(Vector<RefPtr<StyleSheet> >& sheetsForList) const
+{
+ return DocumentStyleSheetCollector(sheetsForList, m_activeAuthorStyleSheets);
+}
+
+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);
}
}

Powered by Google App Engine
This is Rietveld 408576698