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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
(...skipping 13 matching lines...) Expand all Loading... |
24 * along with this library; see the file COPYING.LIB. If not, write to | 24 * along with this library; see the file COPYING.LIB. If not, write to |
25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 * Boston, MA 02110-1301, USA. | 26 * Boston, MA 02110-1301, USA. |
27 * | 27 * |
28 */ | 28 */ |
29 | 29 |
30 #ifndef TreeScopeStyleSheetCollection_h | 30 #ifndef TreeScopeStyleSheetCollection_h |
31 #define TreeScopeStyleSheetCollection_h | 31 #define TreeScopeStyleSheetCollection_h |
32 | 32 |
33 #include "core/CoreExport.h" | 33 #include "core/CoreExport.h" |
| 34 #include "core/dom/Document.h" |
34 #include "core/dom/DocumentOrderedList.h" | 35 #include "core/dom/DocumentOrderedList.h" |
35 #include "core/dom/StyleSheetCollection.h" | 36 #include "core/dom/StyleSheetCollection.h" |
36 #include "core/dom/TreeScope.h" | 37 #include "core/dom/TreeScope.h" |
| 38 #include "wtf/HashMap.h" |
| 39 #include "wtf/ListHashSet.h" |
| 40 #include "wtf/Vector.h" |
| 41 #include "wtf/text/WTFString.h" |
37 | 42 |
38 namespace blink { | 43 namespace blink { |
39 | 44 |
40 class Document; | |
41 class Node; | 45 class Node; |
| 46 class StyleSheetContents; |
| 47 class StyleRuleFontFace; |
42 | 48 |
43 class CORE_EXPORT TreeScopeStyleSheetCollection : public StyleSheetCollection { | 49 class CORE_EXPORT TreeScopeStyleSheetCollection : public StyleSheetCollection { |
44 public: | 50 public: |
45 void addStyleSheetCandidateNode(Node&); | 51 void addStyleSheetCandidateNode(Node&); |
46 void removeStyleSheetCandidateNode(Node& node) { | 52 void removeStyleSheetCandidateNode(Node& node) { |
47 m_styleSheetCandidateNodes.remove(&node); | 53 m_styleSheetCandidateNodes.remove(&node); |
48 } | 54 } |
49 bool hasStyleSheetCandidateNodes() const { | 55 bool hasStyleSheetCandidateNodes() const { |
50 return !m_styleSheetCandidateNodes.isEmpty(); | 56 return !m_styleSheetCandidateNodes.isEmpty(); |
51 } | 57 } |
52 | 58 |
53 bool mediaQueryAffectingValueChanged(); | 59 void clearMediaQueryRuleSetStyleSheets(); |
54 | 60 |
55 virtual bool isShadowTreeStyleSheetCollection() const { return false; } | 61 virtual bool isShadowTreeStyleSheetCollection() const { return false; } |
56 | 62 |
57 DECLARE_VIRTUAL_TRACE(); | 63 DECLARE_VIRTUAL_TRACE(); |
58 | 64 |
59 protected: | 65 protected: |
60 explicit TreeScopeStyleSheetCollection(TreeScope&); | 66 explicit TreeScopeStyleSheetCollection(TreeScope&); |
61 | 67 |
62 Document& document() const { return treeScope().document(); } | 68 Document& document() const { return treeScope().document(); } |
63 TreeScope& treeScope() const { return *m_treeScope; } | 69 TreeScope& treeScope() const { return *m_treeScope; } |
64 | 70 |
65 void applyActiveStyleSheetChanges(StyleSheetCollection&); | 71 enum StyleResolverUpdateType { Reconstruct, Reset, Additive }; |
66 | 72 |
67 Member<TreeScope> m_treeScope; | 73 class StyleSheetChange { |
68 DocumentOrderedList m_styleSheetCandidateNodes; | 74 STACK_ALLOCATED(); |
| 75 |
| 76 public: |
| 77 StyleResolverUpdateType styleResolverUpdateType; |
| 78 bool requiresFullStyleRecalc; |
| 79 HeapVector<Member<const StyleRuleFontFace>> fontFaceRulesToRemove; |
| 80 |
| 81 StyleSheetChange() |
| 82 : styleResolverUpdateType(Reconstruct), requiresFullStyleRecalc(true) {} |
| 83 }; |
| 84 |
| 85 void analyzeStyleSheetChange(StyleResolverUpdateMode, |
| 86 const HeapVector<Member<CSSStyleSheet>>&, |
| 87 StyleSheetChange&); |
69 | 88 |
70 private: | 89 private: |
| 90 static StyleResolverUpdateType compareStyleSheets( |
| 91 const HeapVector<Member<CSSStyleSheet>>& oldStyleSheets, |
| 92 const HeapVector<Member<CSSStyleSheet>>& newStylesheets, |
| 93 HeapVector<Member<StyleSheetContents>>& addedSheets); |
| 94 bool activeLoadingStyleSheetLoaded( |
| 95 const HeapVector<Member<CSSStyleSheet>>& newStyleSheets); |
| 96 |
71 friend class TreeScopeStyleSheetCollectionTest; | 97 friend class TreeScopeStyleSheetCollectionTest; |
| 98 |
| 99 protected: |
| 100 Member<TreeScope> m_treeScope; |
| 101 bool m_hadActiveLoadingStylesheet; |
| 102 |
| 103 DocumentOrderedList m_styleSheetCandidateNodes; |
72 }; | 104 }; |
73 | 105 |
74 } // namespace blink | 106 } // namespace blink |
75 | 107 |
76 #endif | 108 #endif |
OLD | NEW |