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 markTreeScopeDirty(*treeScope); |
tasak
2015/04/30 08:16:20
I think, we should check the styleSheetCandidateNo
rune
2015/04/30 08:35:45
Done.
| |
247 | 247 |
248 // Make sure we knew this sheet was pending, and that our count isn't out of sync. | 248 // Make sure we knew this sheet was pending, and that our count isn't out of sync. |
249 ASSERT(m_pendingStylesheets > 0); | 249 ASSERT(m_pendingStylesheets > 0); |
250 | 250 |
251 m_pendingStylesheets--; | 251 m_pendingStylesheets--; |
252 if (m_pendingStylesheets) | 252 if (m_pendingStylesheets) |
253 return; | 253 return; |
254 | 254 |
255 // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we don't know | 255 // 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. | 256 // 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(); | 572 m_resolver->invalidateMatchedPropertiesCache(); |
573 } | 573 } |
574 | 574 |
575 void StyleEngine::markTreeScopeDirty(TreeScope& scope) | 575 void StyleEngine::markTreeScopeDirty(TreeScope& scope) |
576 { | 576 { |
577 if (scope == m_document) { | 577 if (scope == m_document) { |
578 markDocumentDirty(); | 578 markDocumentDirty(); |
579 return; | 579 return; |
580 } | 580 } |
581 | 581 |
582 m_dirtyTreeScopes.add(&scope); | 582 if (m_styleSheetCollectionMap.contains(&scope)) |
tasak
2015/04/30 08:16:20
I think, it would be better to use ASSERT here, i.
rune
2015/04/30 08:35:45
Done.
| |
583 m_dirtyTreeScopes.add(&scope); | |
583 } | 584 } |
584 | 585 |
585 void StyleEngine::markDocumentDirty() | 586 void StyleEngine::markDocumentDirty() |
586 { | 587 { |
587 m_documentScopeDirty = true; | 588 m_documentScopeDirty = true; |
588 if (document().importLoader()) | 589 if (document().importLoader()) |
589 document().importsController()->master()->styleEngine().markDocumentDirt y(); | 590 document().importsController()->master()->styleEngine().markDocumentDirt y(); |
590 } | 591 } |
591 | 592 |
592 static bool isCacheableForStyleElement(const StyleSheetContents& contents) | 593 static bool isCacheableForStyleElement(const StyleSheetContents& contents) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
705 visitor->trace(m_dirtyTreeScopes); | 706 visitor->trace(m_dirtyTreeScopes); |
706 visitor->trace(m_activeTreeScopes); | 707 visitor->trace(m_activeTreeScopes); |
707 visitor->trace(m_fontSelector); | 708 visitor->trace(m_fontSelector); |
708 visitor->trace(m_textToSheetCache); | 709 visitor->trace(m_textToSheetCache); |
709 visitor->trace(m_sheetToTextCache); | 710 visitor->trace(m_sheetToTextCache); |
710 #endif | 711 #endif |
711 CSSFontSelectorClient::trace(visitor); | 712 CSSFontSelectorClient::trace(visitor); |
712 } | 713 } |
713 | 714 |
714 } | 715 } |
OLD | NEW |