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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 class ContainerNode; | 44 class ContainerNode; |
45 class CSSStyleSheet; | 45 class CSSStyleSheet; |
46 class StyleEngine; | 46 class StyleEngine; |
47 class Node; | 47 class Node; |
48 class StyleSheet; | 48 class StyleSheet; |
49 class StyleSheetContents; | 49 class StyleSheetContents; |
50 class StyleSheetList; | 50 class StyleSheetList; |
| 51 class StyleRuleFontFace; |
51 | 52 |
52 // FIXME: Should be in separate file and be renamed like: | 53 // FIXME: Should be in separate file and be renamed like: |
53 // - StyleSheetCollectionBase -> StyleSheetCollection | 54 // - StyleSheetCollectionBase -> StyleSheetCollection |
54 // - StyleSheetCollection -> ScopeStyleSheetCollection | 55 // - StyleSheetCollection -> ScopeStyleSheetCollection |
55 // | 56 // |
56 class StyleSheetCollectionBase { | 57 class StyleSheetCollectionBase { |
57 WTF_MAKE_NONCOPYABLE(StyleSheetCollectionBase); WTF_MAKE_FAST_ALLOCATED; | 58 WTF_MAKE_NONCOPYABLE(StyleSheetCollectionBase); WTF_MAKE_FAST_ALLOCATED; |
58 public: | 59 public: |
59 StyleSheetCollectionBase(); | 60 StyleSheetCollectionBase(); |
60 ~StyleSheetCollectionBase(); | 61 ~StyleSheetCollectionBase(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 93 |
93 protected: | 94 protected: |
94 explicit StyleSheetCollection(TreeScope&); | 95 explicit StyleSheetCollection(TreeScope&); |
95 | 96 |
96 // FIXME: Should return a reference. | 97 // FIXME: Should return a reference. |
97 Document* document() { return &m_treeScope.document(); } | 98 Document* document() { return &m_treeScope.document(); } |
98 | 99 |
99 enum StyleResolverUpdateType { | 100 enum StyleResolverUpdateType { |
100 Reconstruct, | 101 Reconstruct, |
101 Reset, | 102 Reset, |
102 Additive, | 103 Additive |
103 ResetStyleResolverAndFontSelector | |
104 }; | 104 }; |
105 | 105 |
106 struct StyleSheetChange { | 106 struct StyleSheetChange { |
107 StyleResolverUpdateType styleResolverUpdateType; | 107 StyleResolverUpdateType styleResolverUpdateType; |
108 bool requiresFullStyleRecalc; | 108 bool requiresFullStyleRecalc; |
| 109 Vector<const StyleRuleFontFace*> fontFaceRulesToRemove; |
109 | 110 |
110 StyleSheetChange() | 111 StyleSheetChange() |
111 : styleResolverUpdateType(Reconstruct) | 112 : styleResolverUpdateType(Reconstruct) |
112 , requiresFullStyleRecalc(true) { } | 113 , requiresFullStyleRecalc(true) { } |
113 }; | 114 }; |
114 | 115 |
115 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tionBase&, StyleSheetChange&); | 116 void analyzeStyleSheetChange(StyleResolverUpdateMode, const StyleSheetCollec
tionBase&, StyleSheetChange&); |
116 void resetAllRuleSetsInTreeScope(StyleResolver*); | 117 void resetAllRuleSetsInTreeScope(StyleResolver*); |
117 void updateUsesRemUnits(); | 118 void updateUsesRemUnits(); |
118 | 119 |
119 private: | 120 private: |
120 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); | 121 static StyleResolverUpdateType compareStyleSheets(const Vector<RefPtr<CSSSty
leSheet> >& oldStyleSheets, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets
, Vector<StyleSheetContents*>& addedSheets); |
121 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); | 122 bool activeLoadingStyleSheetLoaded(const Vector<RefPtr<CSSStyleSheet> >& new
StyleSheets); |
122 | 123 |
123 protected: | 124 protected: |
124 TreeScope& m_treeScope; | 125 TreeScope& m_treeScope; |
125 bool m_hadActiveLoadingStylesheet; | 126 bool m_hadActiveLoadingStylesheet; |
126 bool m_usesRemUnits; | 127 bool m_usesRemUnits; |
127 | 128 |
128 DocumentOrderedList m_styleSheetCandidateNodes; | 129 DocumentOrderedList m_styleSheetCandidateNodes; |
129 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; | 130 StyleSheetScopingNodeList m_scopingNodesForStyleScoped; |
130 }; | 131 }; |
131 | 132 |
132 } | 133 } |
133 | 134 |
134 #endif | 135 #endif |
135 | 136 |
OLD | NEW |