| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void StyleEngine::addPendingSheet() | 236 void StyleEngine::addPendingSheet() |
| 237 { | 237 { |
| 238 m_pendingStylesheets++; | 238 m_pendingStylesheets++; |
| 239 } | 239 } |
| 240 | 240 |
| 241 // This method is called whenever a top-level stylesheet has finished loading. | 241 // This method is called whenever a top-level stylesheet has finished loading. |
| 242 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) | 242 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) |
| 243 { | 243 { |
| 244 ASSERT(styleSheetCandidateNode); | 244 ASSERT(styleSheetCandidateNode); |
| 245 TreeScope* treeScope = isStyleElement(*styleSheetCandidateNode) ? &styleShee
tCandidateNode->treeScope() : m_document.get(); | 245 TreeScope* treeScope = isStyleElement(*styleSheetCandidateNode) ? &styleShee
tCandidateNode->treeScope() : m_document.get(); |
| 246 markTreeScopeDirty(*treeScope); | 246 if (styleSheetCandidateNode->inDocument()) |
| 247 markTreeScopeDirty(*treeScope); |
| 247 | 248 |
| 248 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. | 249 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. |
| 249 ASSERT(m_pendingStylesheets > 0); | 250 ASSERT(m_pendingStylesheets > 0); |
| 250 | 251 |
| 251 m_pendingStylesheets--; | 252 m_pendingStylesheets--; |
| 252 if (m_pendingStylesheets) | 253 if (m_pendingStylesheets) |
| 253 return; | 254 return; |
| 254 | 255 |
| 255 // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we
don't know | 256 // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we
don't know |
| 256 // what's new. We should track that to tell the style system what changed. | 257 // what's new. We should track that to tell the style system what changed. |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 m_resolver->invalidateMatchedPropertiesCache(); | 573 m_resolver->invalidateMatchedPropertiesCache(); |
| 573 } | 574 } |
| 574 | 575 |
| 575 void StyleEngine::markTreeScopeDirty(TreeScope& scope) | 576 void StyleEngine::markTreeScopeDirty(TreeScope& scope) |
| 576 { | 577 { |
| 577 if (scope == m_document) { | 578 if (scope == m_document) { |
| 578 markDocumentDirty(); | 579 markDocumentDirty(); |
| 579 return; | 580 return; |
| 580 } | 581 } |
| 581 | 582 |
| 583 ASSERT(m_styleSheetCollectionMap.contains(&scope)); |
| 582 m_dirtyTreeScopes.add(&scope); | 584 m_dirtyTreeScopes.add(&scope); |
| 583 } | 585 } |
| 584 | 586 |
| 585 void StyleEngine::markDocumentDirty() | 587 void StyleEngine::markDocumentDirty() |
| 586 { | 588 { |
| 587 m_documentScopeDirty = true; | 589 m_documentScopeDirty = true; |
| 588 if (document().importLoader()) | 590 if (document().importLoader()) |
| 589 document().importsController()->master()->styleEngine().markDocumentDirt
y(); | 591 document().importsController()->master()->styleEngine().markDocumentDirt
y(); |
| 590 } | 592 } |
| 591 | 593 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 visitor->trace(m_dirtyTreeScopes); | 707 visitor->trace(m_dirtyTreeScopes); |
| 706 visitor->trace(m_activeTreeScopes); | 708 visitor->trace(m_activeTreeScopes); |
| 707 visitor->trace(m_fontSelector); | 709 visitor->trace(m_fontSelector); |
| 708 visitor->trace(m_textToSheetCache); | 710 visitor->trace(m_textToSheetCache); |
| 709 visitor->trace(m_sheetToTextCache); | 711 visitor->trace(m_sheetToTextCache); |
| 710 #endif | 712 #endif |
| 711 CSSFontSelectorClient::trace(visitor); | 713 CSSFontSelectorClient::trace(visitor); |
| 712 } | 714 } |
| 713 | 715 |
| 714 } | 716 } |
| OLD | NEW |