| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 void StyleEngine::removeTreeScope(TreeScope& scope) | 66 void StyleEngine::removeTreeScope(TreeScope& scope) |
| 67 { | 67 { |
| 68 m_activeTreeScopes.remove(&scope); | 68 m_activeTreeScopes.remove(&scope); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void StyleEngine::updateActiveStyleSheets() | 71 void StyleEngine::updateActiveStyleSheets() |
| 72 { | 72 { |
| 73 ASSERT(!m_document->inStyleRecalc()); | 73 ASSERT(!m_document->inStyleRecalc()); |
| 74 | 74 ASSERT(m_resolver); |
| 75 if (!m_document->isActive()) | |
| 76 return; | |
| 77 | 75 |
| 78 for (TreeScope* treeScope : m_activeTreeScopes) | 76 for (TreeScope* treeScope : m_activeTreeScopes) |
| 79 treeScope->styleSheets().updateActiveStyleSheets(this); | 77 treeScope->styleSheets().updateActiveStyleSheets(*m_resolver); |
| 80 } | 78 } |
| 81 | 79 |
| 82 void StyleEngine::appendActiveAuthorStyleSheets() | 80 void StyleEngine::appendActiveAuthorStyleSheets() |
| 83 { | 81 { |
| 84 for (TreeScope* treeScope : m_activeTreeScopes) | 82 for (TreeScope* treeScope : m_activeTreeScopes) |
| 85 m_resolver->appendAuthorStyleSheets(treeScope->styleSheets().activeAutho
rStyleSheets()); | 83 m_resolver->appendAuthorStyleSheets(treeScope->styleSheets().activeAutho
rStyleSheets()); |
| 86 | 84 |
| 87 m_resolver->finishAppendAuthorStyleSheets(); | 85 m_resolver->finishAppendAuthorStyleSheets(); |
| 88 } | 86 } |
| 89 | 87 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 106 m_resolver.clear(); | 104 m_resolver.clear(); |
| 107 } | 105 } |
| 108 | 106 |
| 109 unsigned StyleEngine::resolverAccessCount() const | 107 unsigned StyleEngine::resolverAccessCount() const |
| 110 { | 108 { |
| 111 return m_resolver ? m_resolver->accessCount() : 0; | 109 return m_resolver ? m_resolver->accessCount() : 0; |
| 112 } | 110 } |
| 113 | 111 |
| 114 void StyleEngine::resolverChanged() | 112 void StyleEngine::resolverChanged() |
| 115 { | 113 { |
| 116 // Don't bother updating, since we haven't loaded all our style info yet | 114 if (!m_document->isActive()) |
| 117 // and haven't calculated the style selector for the first time. | |
| 118 if (!m_document->isActive()) { | |
| 119 clearResolver(); | |
| 120 return; | 115 return; |
| 121 } | 116 if (m_resolver) |
| 122 | 117 updateActiveStyleSheets(); |
| 123 updateActiveStyleSheets(); | |
| 124 } | 118 } |
| 125 | 119 |
| 126 void StyleEngine::clearFontCache() | 120 void StyleEngine::clearFontCache() |
| 127 { | 121 { |
| 128 m_fontSelector->fontFaceCache()->clearCSSConnected(); | 122 m_fontSelector->fontFaceCache()->clearCSSConnected(); |
| 129 if (m_resolver) | 123 if (m_resolver) |
| 130 m_resolver->invalidateMatchedPropertiesCache(); | 124 m_resolver->invalidateMatchedPropertiesCache(); |
| 131 } | 125 } |
| 132 | 126 |
| 133 void StyleEngine::updateGenericFontFamilySettings() | 127 void StyleEngine::updateGenericFontFamilySettings() |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 169 } |
| 176 | 170 |
| 177 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) | 171 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) |
| 178 { | 172 { |
| 179 if (m_resolver) | 173 if (m_resolver) |
| 180 m_resolver->invalidateMatchedPropertiesCache(); | 174 m_resolver->invalidateMatchedPropertiesCache(); |
| 181 m_document->setNeedsStyleRecalc(SubtreeStyleChange); | 175 m_document->setNeedsStyleRecalc(SubtreeStyleChange); |
| 182 } | 176 } |
| 183 | 177 |
| 184 } | 178 } |
| OLD | NEW |