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

Unified Diff: sky/engine/core/dom/StyleSheetCollection.h

Issue 799393005: Merge all StyleSheetCollections. (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
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/engine/core/dom/StyleSheetCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/StyleSheetCollection.h
diff --git a/sky/engine/core/dom/StyleSheetCollection.h b/sky/engine/core/dom/StyleSheetCollection.h
index b140fe8255b663ab21e7ef3df5ac1c3d11f2f094..48d2377db2004cef7770eaf8085fdf607db03ade 100644
--- a/sky/engine/core/dom/StyleSheetCollection.h
+++ b/sky/engine/core/dom/StyleSheetCollection.h
@@ -28,31 +28,46 @@
#ifndef SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_
#define SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_
-#include "sky/engine/platform/heap/Handle.h"
+#include "sky/engine/core/dom/DocumentOrderedList.h"
#include "sky/engine/wtf/FastAllocBase.h"
+#include "sky/engine/wtf/PassOwnPtr.h"
#include "sky/engine/wtf/RefPtr.h"
#include "sky/engine/wtf/Vector.h"
namespace blink {
class CSSStyleSheet;
+class ContainerNode;
+class StyleEngine;
+class TreeScope;
class StyleSheetCollection {
WTF_MAKE_NONCOPYABLE(StyleSheetCollection);
WTF_MAKE_FAST_ALLOCATED;
public:
- StyleSheetCollection();
- virtual ~StyleSheetCollection();
+ static PassOwnPtr<StyleSheetCollection> create(TreeScope& treeScope)
+ {
+ return adoptPtr(new StyleSheetCollection(treeScope));
+ }
+ ~StyleSheetCollection();
Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeAuthorStyleSheets; }
const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const { return m_activeAuthorStyleSheets; }
- void swap(StyleSheetCollection&);
- void appendActiveStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&);
- void appendActiveStyleSheet(CSSStyleSheet*);
+ void addStyleSheetCandidateNode(Node*, bool createdByParser);
+ void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode);
+ bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNodes.isEmpty(); }
-protected:
- Vector<RefPtr<CSSStyleSheet> > m_activeAuthorStyleSheets;
+ void updateActiveStyleSheets(StyleEngine*);
+
+private:
+ explicit StyleSheetCollection(TreeScope&);
+
+ void collectStyleSheets(Vector<RefPtr<CSSStyleSheet>>& candidateSheets);
+
+ TreeScope& m_treeScope;
+ DocumentOrderedList m_styleSheetCandidateNodes;
+ Vector<RefPtr<CSSStyleSheet>> m_activeAuthorStyleSheets;
};
}
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/engine/core/dom/StyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698