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, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 m_usesSiblingRules = features.usesSiblingRules(); | 150 m_usesSiblingRules = features.usesSiblingRules(); |
151 m_usesFirstLineRules = features.usesFirstLineRules(); | 151 m_usesFirstLineRules = features.usesFirstLineRules(); |
152 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector(); | 152 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector(); |
153 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors(); | 153 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors(); |
154 } | 154 } |
155 | 155 |
156 void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a
uthorSheet) | 156 void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a
uthorSheet) |
157 { | 157 { |
158 m_injectedAuthorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_docu
ment)); | 158 m_injectedAuthorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_docu
ment)); |
159 markDocumentDirty(); | 159 markDocumentDirty(); |
160 document().addedStyleSheet(m_injectedAuthorStyleSheets.last().get()); | 160 resolverChanged(FullStyleUpdate); |
161 } | 161 } |
162 | 162 |
163 void StyleEngine::addPendingSheet() | 163 void StyleEngine::addPendingSheet() |
164 { | 164 { |
165 m_pendingStylesheets++; | 165 m_pendingStylesheets++; |
166 } | 166 } |
167 | 167 |
168 // This method is called whenever a top-level stylesheet has finished loading. | 168 // This method is called whenever a top-level stylesheet has finished loading. |
169 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) | 169 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) |
170 { | 170 { |
171 ASSERT(styleSheetCandidateNode); | 171 ASSERT(styleSheetCandidateNode); |
172 TreeScope* treeScope = isStyleElement(*styleSheetCandidateNode) ? &styleShee
tCandidateNode->treeScope() : m_document.get(); | 172 TreeScope* treeScope = isStyleElement(*styleSheetCandidateNode) ? &styleShee
tCandidateNode->treeScope() : m_document.get(); |
173 if (styleSheetCandidateNode->inDocument()) | 173 if (styleSheetCandidateNode->inDocument()) |
174 markTreeScopeDirty(*treeScope); | 174 markTreeScopeDirty(*treeScope); |
175 | 175 |
176 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. | 176 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. |
177 ASSERT(m_pendingStylesheets > 0); | 177 ASSERT(m_pendingStylesheets > 0); |
178 | 178 |
179 m_pendingStylesheets--; | 179 m_pendingStylesheets--; |
180 if (m_pendingStylesheets) | 180 if (m_pendingStylesheets) |
181 return; | 181 return; |
182 | 182 |
183 // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we
don't know | |
184 // what's new. We should track that to tell the style system what changed. | |
185 document().didRemoveAllPendingStylesheet(); | 183 document().didRemoveAllPendingStylesheet(); |
186 } | 184 } |
187 | 185 |
188 void StyleEngine::modifiedStyleSheet(StyleSheet* sheet) | 186 void StyleEngine::modifiedStyleSheet(StyleSheet* sheet) |
189 { | 187 { |
190 if (!sheet) | 188 if (!sheet) |
191 return; | 189 return; |
192 | 190 |
193 Node* node = sheet->ownerNode(); | 191 Node* node = sheet->ownerNode(); |
194 if (!node || !node->inDocument()) | 192 if (!node || !node->inDocument()) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 236 } |
239 | 237 |
240 void StyleEngine::modifiedStyleSheetCandidateNode(Node* node) | 238 void StyleEngine::modifiedStyleSheetCandidateNode(Node* node) |
241 { | 239 { |
242 if (!node->inDocument()) | 240 if (!node->inDocument()) |
243 return; | 241 return; |
244 | 242 |
245 TreeScope& treeScope = isStyleElement(*node) ? node->treeScope() : *m_docume
nt; | 243 TreeScope& treeScope = isStyleElement(*node) ? node->treeScope() : *m_docume
nt; |
246 ASSERT(isStyleElement(*node) || treeScope == m_document); | 244 ASSERT(isStyleElement(*node) || treeScope == m_document); |
247 markTreeScopeDirty(treeScope); | 245 markTreeScopeDirty(treeScope); |
| 246 resolverChanged(FullStyleUpdate); |
248 } | 247 } |
249 | 248 |
250 bool StyleEngine::shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMo
de updateMode) const | 249 bool StyleEngine::shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMo
de updateMode) const |
251 { | 250 { |
252 return m_documentScopeDirty || updateMode == FullStyleUpdate; | 251 return m_documentScopeDirty || updateMode == FullStyleUpdate; |
253 } | 252 } |
254 | 253 |
255 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate
Mode updateMode) const | 254 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate
Mode updateMode) const |
256 { | 255 { |
257 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate; | 256 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate; |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 visitor->trace(m_dirtyTreeScopes); | 735 visitor->trace(m_dirtyTreeScopes); |
737 visitor->trace(m_activeTreeScopes); | 736 visitor->trace(m_activeTreeScopes); |
738 visitor->trace(m_fontSelector); | 737 visitor->trace(m_fontSelector); |
739 visitor->trace(m_textToSheetCache); | 738 visitor->trace(m_textToSheetCache); |
740 visitor->trace(m_sheetToTextCache); | 739 visitor->trace(m_sheetToTextCache); |
741 #endif | 740 #endif |
742 CSSFontSelectorClient::trace(visitor); | 741 CSSFontSelectorClient::trace(visitor); |
743 } | 742 } |
744 | 743 |
745 } // namespace blink | 744 } // namespace blink |
OLD | NEW |