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) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine,
StyleResolverUpdateMode updateMode) | 128 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine,
StyleResolverUpdateMode updateMode) |
129 { | 129 { |
130 DocumentStyleSheetCollector collector(m_treeScope); | 130 DocumentStyleSheetCollector collector(m_treeScope); |
131 collectStyleSheets(engine, collector); | 131 collectStyleSheets(engine, collector); |
132 | 132 |
133 StyleSheetChange change; | 133 StyleSheetChange change; |
134 analyzeStyleSheetChange(updateMode, collector.collection(), change); | 134 analyzeStyleSheetChange(updateMode, collector.collection(), change); |
135 | 135 |
136 if (change.styleResolverUpdateType == Reconstruct) { | 136 if (change.styleResolverUpdateType == Reconstruct) { |
137 engine->clearMasterResolver(); | 137 engine->clearMasterResolver(); |
| 138 // FIMXE: The following depends on whether StyleRuleFontFace was modifie
d or not. |
| 139 // No need to always-reset. |
138 engine->resetFontSelector(); | 140 engine->resetFontSelector(); |
139 } else if (StyleResolver* styleResolver = engine->resolver()) { | 141 } else if (StyleResolver* styleResolver = engine->resolver()) { |
140 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. | 142 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. |
141 // Need to change "false" to some valid condition. | 143 // Need to change "false" to some valid condition. |
142 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); | 144 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); |
143 if (change.styleResolverUpdateType != Additive) { | 145 if (change.styleResolverUpdateType != Additive) { |
144 ASSERT(change.styleResolverUpdateType == Reset || change.styleResolv
erUpdateType == ResetStyleResolverAndFontSelector); | 146 ASSERT(change.styleResolverUpdateType == Reset); |
145 resetAllRuleSetsInTreeScope(styleResolver); | 147 resetAllRuleSetsInTreeScope(styleResolver); |
146 if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelec
tor) | 148 engine->removeFontFaceRules(change.fontFaceRulesToRemove); |
147 engine->resetFontSelector(); | |
148 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe
ets); | 149 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe
ets); |
149 styleResolver->lazyAppendAuthorStyleSheets(0, collector.collection()
.activeAuthorStyleSheets()); | 150 styleResolver->lazyAppendAuthorStyleSheets(0, collector.collection()
.activeAuthorStyleSheets()); |
150 } else { | 151 } else { |
151 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets
.size(), collector.collection().activeAuthorStyleSheets()); | 152 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets
.size(), collector.collection().activeAuthorStyleSheets()); |
152 } | 153 } |
153 } else if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelect
or) { | |
154 engine->resetFontSelector(); | |
155 } | 154 } |
156 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); | 155 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); |
157 collector.setCollectionTo(*this); | 156 collector.setCollectionTo(*this); |
158 updateUsesRemUnits(); | 157 updateUsesRemUnits(); |
159 | 158 |
160 return change.requiresFullStyleRecalc; | 159 return change.requiresFullStyleRecalc; |
161 } | 160 } |
162 | 161 |
163 } | 162 } |
OLD | NEW |