| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet>>& StyleEngine::styleSheets
ForStyleSheetList(TreeScope& treeScope) | 131 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet>>& StyleEngine::styleSheets
ForStyleSheetList(TreeScope& treeScope) |
| 132 { | 132 { |
| 133 if (treeScope == m_document) | 133 if (treeScope == m_document) |
| 134 return documentStyleSheetCollection()->styleSheetsForStyleSheetList(); | 134 return documentStyleSheetCollection()->styleSheetsForStyleSheetList(); |
| 135 | 135 |
| 136 return ensureStyleSheetCollectionFor(treeScope)->styleSheetsForStyleSheetLis
t(); | 136 return ensureStyleSheetCollectionFor(treeScope)->styleSheetsForStyleSheetLis
t(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void StyleEngine::combineCSSFeatureFlags(const RuleFeatureSet& features) | |
| 140 { | |
| 141 // Delay resetting the flags until after next style recalc since unapplying
the style may not work without these set (this is true at least with before/afte
r). | |
| 142 m_usesSiblingRules = m_usesSiblingRules || features.usesSiblingRules(); | |
| 143 m_usesFirstLineRules = m_usesFirstLineRules || features.usesFirstLineRules()
; | |
| 144 m_usesWindowInactiveSelector = m_usesWindowInactiveSelector || features.uses
WindowInactiveSelector(); | |
| 145 m_maxDirectAdjacentSelectors = max(m_maxDirectAdjacentSelectors, features.ma
xDirectAdjacentSelectors()); | |
| 146 } | |
| 147 | |
| 148 void StyleEngine::resetCSSFeatureFlags(const RuleFeatureSet& features) | 139 void StyleEngine::resetCSSFeatureFlags(const RuleFeatureSet& features) |
| 149 { | 140 { |
| 150 m_usesSiblingRules = features.usesSiblingRules(); | 141 m_usesSiblingRules = features.usesSiblingRules(); |
| 151 m_usesFirstLineRules = features.usesFirstLineRules(); | 142 m_usesFirstLineRules = features.usesFirstLineRules(); |
| 152 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector(); | 143 m_usesWindowInactiveSelector = features.usesWindowInactiveSelector(); |
| 153 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors(); | 144 m_maxDirectAdjacentSelectors = features.maxDirectAdjacentSelectors(); |
| 154 } | 145 } |
| 155 | 146 |
| 156 void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a
uthorSheet) | 147 void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a
uthorSheet) |
| 157 { | 148 { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // which is not in a frame. Code which hits this should have checked | 376 // which is not in a frame. Code which hits this should have checked |
| 386 // Document::isActive() before calling into code which could get here. | 377 // Document::isActive() before calling into code which could get here. |
| 387 | 378 |
| 388 ASSERT(document().frame()); | 379 ASSERT(document().frame()); |
| 389 | 380 |
| 390 m_resolver = StyleResolver::create(*m_document); | 381 m_resolver = StyleResolver::create(*m_document); |
| 391 | 382 |
| 392 // A scoped style resolver for document will be created during | 383 // A scoped style resolver for document will be created during |
| 393 // appendActiveAuthorStyleSheets if needed. | 384 // appendActiveAuthorStyleSheets if needed. |
| 394 appendActiveAuthorStyleSheets(); | 385 appendActiveAuthorStyleSheets(); |
| 395 combineCSSFeatureFlags(m_resolver->ensureUpdatedRuleFeatureSet()); | |
| 396 } | 386 } |
| 397 | 387 |
| 398 void StyleEngine::clearResolver() | 388 void StyleEngine::clearResolver() |
| 399 { | 389 { |
| 400 ASSERT(!document().inStyleRecalc()); | 390 ASSERT(!document().inStyleRecalc()); |
| 401 ASSERT(isMaster() || !m_resolver); | 391 ASSERT(isMaster() || !m_resolver); |
| 402 | 392 |
| 403 document().clearScopedStyleResolver(); | 393 document().clearScopedStyleResolver(); |
| 404 // StyleEngine::shadowRootRemovedFromDocument removes not-in-document | 394 // StyleEngine::shadowRootRemovedFromDocument removes not-in-document |
| 405 // treescopes from activeTreeScopes. StyleEngine::didRemoveShadowRoot | 395 // treescopes from activeTreeScopes. StyleEngine::didRemoveShadowRoot |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 visitor->trace(m_dirtyTreeScopes); | 725 visitor->trace(m_dirtyTreeScopes); |
| 736 visitor->trace(m_activeTreeScopes); | 726 visitor->trace(m_activeTreeScopes); |
| 737 visitor->trace(m_fontSelector); | 727 visitor->trace(m_fontSelector); |
| 738 visitor->trace(m_textToSheetCache); | 728 visitor->trace(m_textToSheetCache); |
| 739 visitor->trace(m_sheetToTextCache); | 729 visitor->trace(m_sheetToTextCache); |
| 740 #endif | 730 #endif |
| 741 CSSFontSelectorClient::trace(visitor); | 731 CSSFontSelectorClient::trace(visitor); |
| 742 } | 732 } |
| 743 | 733 |
| 744 } // namespace blink | 734 } // namespace blink |
| OLD | NEW |