| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * You should have received a copy of the GNU Library General Public License | 21 * You should have received a copy of the GNU Library General Public License |
| 22 * along with this library; see the file COPYING.LIB. If not, write to | 22 * along with this library; see the file COPYING.LIB. If not, write to |
| 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ | 28 #ifndef SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ |
| 29 #define SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ | 29 #define SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ |
| 30 | 30 |
| 31 #include "sky/engine/platform/heap/Handle.h" | 31 #include "sky/engine/core/dom/DocumentOrderedList.h" |
| 32 #include "sky/engine/wtf/FastAllocBase.h" | 32 #include "sky/engine/wtf/FastAllocBase.h" |
| 33 #include "sky/engine/wtf/PassOwnPtr.h" |
| 33 #include "sky/engine/wtf/RefPtr.h" | 34 #include "sky/engine/wtf/RefPtr.h" |
| 34 #include "sky/engine/wtf/Vector.h" | 35 #include "sky/engine/wtf/Vector.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class CSSStyleSheet; | 39 class CSSStyleSheet; |
| 40 class ContainerNode; |
| 41 class StyleEngine; |
| 42 class TreeScope; |
| 39 | 43 |
| 40 class StyleSheetCollection { | 44 class StyleSheetCollection { |
| 41 WTF_MAKE_NONCOPYABLE(StyleSheetCollection); | 45 WTF_MAKE_NONCOPYABLE(StyleSheetCollection); |
| 42 WTF_MAKE_FAST_ALLOCATED; | 46 WTF_MAKE_FAST_ALLOCATED; |
| 43 public: | 47 public: |
| 44 StyleSheetCollection(); | 48 static PassOwnPtr<StyleSheetCollection> create(TreeScope& treeScope) |
| 45 virtual ~StyleSheetCollection(); | 49 { |
| 50 return adoptPtr(new StyleSheetCollection(treeScope)); |
| 51 } |
| 52 ~StyleSheetCollection(); |
| 46 | 53 |
| 47 Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeA
uthorStyleSheets; } | 54 Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeA
uthorStyleSheets; } |
| 48 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const { retu
rn m_activeAuthorStyleSheets; } | 55 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const { retu
rn m_activeAuthorStyleSheets; } |
| 49 | 56 |
| 50 void swap(StyleSheetCollection&); | 57 void addStyleSheetCandidateNode(Node*, bool createdByParser); |
| 51 void appendActiveStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&); | 58 void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode); |
| 52 void appendActiveStyleSheet(CSSStyleSheet*); | 59 bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNode
s.isEmpty(); } |
| 53 | 60 |
| 54 protected: | 61 void updateActiveStyleSheets(StyleEngine*); |
| 55 Vector<RefPtr<CSSStyleSheet> > m_activeAuthorStyleSheets; | 62 |
| 63 private: |
| 64 explicit StyleSheetCollection(TreeScope&); |
| 65 |
| 66 void collectStyleSheets(Vector<RefPtr<CSSStyleSheet>>& candidateSheets); |
| 67 |
| 68 TreeScope& m_treeScope; |
| 69 DocumentOrderedList m_styleSheetCandidateNodes; |
| 70 Vector<RefPtr<CSSStyleSheet>> m_activeAuthorStyleSheets; |
| 56 }; | 71 }; |
| 57 | 72 |
| 58 } | 73 } |
| 59 | 74 |
| 60 #endif // SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ | 75 #endif // SKY_ENGINE_CORE_DOM_STYLESHEETCOLLECTION_H_ |
| 61 | 76 |
| OLD | NEW |