Chromium Code Reviews| Index: Source/core/dom/DocumentStyleSheetCollector.cpp |
| diff --git a/Source/core/dom/DocumentStyleSheetCollector.cpp b/Source/core/dom/DocumentStyleSheetCollector.cpp |
| index a25d824dd4decd270d4931135a38af142cb93a4d..ef7063715da62b5560a27f8d77b624040226eba0 100644 |
| --- a/Source/core/dom/DocumentStyleSheetCollector.cpp |
| +++ b/Source/core/dom/DocumentStyleSheetCollector.cpp |
| @@ -27,13 +27,18 @@ |
| #include "config.h" |
| #include "core/dom/DocumentStyleSheetCollector.h" |
| +#include "core/css/StyleSheet.h" |
| #include "core/dom/Document.h" |
| namespace WebCore { |
| -bool DocumentStyleSheetCollector::isCollectingForList(TreeScope& scope) const |
| +DocumentStyleSheetCollector::DocumentStyleSheetCollector(TreeScope& root) |
| + : m_root(root) |
| +{ |
| +} |
| + |
| +DocumentStyleSheetCollector::~DocumentStyleSheetCollector() |
| { |
| - return m_root == scope; |
| } |
| void DocumentStyleSheetCollector::setCollectionTo(StyleSheetCollectionBase& collection) |
| @@ -41,4 +46,25 @@ void DocumentStyleSheetCollector::setCollectionTo(StyleSheetCollectionBase& coll |
| m_collection.swap(collection); |
| } |
| +void DocumentStyleSheetCollector::appendSheetForList(StyleSheet* sheet) |
|
esprehn
2014/01/23 07:51:03
reference?
Hajime Morrita
2014/01/24 01:25:51
This is aligned to DocumentStyleSheetCollection AP
|
| +{ |
| + Document& ownerDocument = sheet->ownerNode()->document(); |
| + if (ownerDocument == m_root) { |
| + m_collection.appendSheetForList(sheet); |
| + } else { |
| + ASSERT(m_sheetListMap.contains(&ownerDocument)); |
| + m_sheetListMap.find(&ownerDocument)->value.append(sheet); |
| + } |
| +} |
| + |
| +void DocumentStyleSheetCollector::markVisited(Document* document) |
| +{ |
| + m_sheetListMap.add(document, SheetList()); |
| +} |
| + |
| +bool DocumentStyleSheetCollector::hasVisited(Document* document) const |
| +{ |
| + return m_sheetListMap.contains(document); |
|
esprehn
2014/01/23 07:51:03
This seems like the wrong abstraction, the StyleEn
Hajime Morrita
2014/01/24 01:25:51
Makes sense. Changed the approach.
|
| +} |
| + |
| } |