| 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, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collec
tions, StyleResolverUpdateMode updateMode) | 97 bool ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collec
tions, StyleResolverUpdateMode updateMode) |
| 98 { | 98 { |
| 99 Vector<RefPtr<StyleSheet> > styleSheets; | 99 Vector<RefPtr<StyleSheet> > styleSheets; |
| 100 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; | 100 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; |
| 101 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); | 101 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); |
| 102 | 102 |
| 103 bool requiresFullStyleRecalc = true; | 103 bool requiresFullStyleRecalc = true; |
| 104 bool requiresResetFontSelector = false; |
| 104 | 105 |
| 105 StyleResolverUpdateType styleResolverUpdateType; | 106 StyleResolverUpdateType styleResolverUpdateType; |
| 106 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, styleResolverUpdateType, requiresFullStyleRecalc); | 107 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, styleResolverUpdateType, requiresFullStyleRecalc, requiresResetFontSele
ctor); |
| 107 | 108 |
| 108 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { | 109 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { |
| 109 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. | 110 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. |
| 110 // Need to change "false" to some valid condition. | 111 // Need to change "false" to some valid condition. |
| 111 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); | 112 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); |
| 112 if (styleResolverUpdateType == Reset || styleResolverUpdateType == Recon
struct) { | 113 if (styleResolverUpdateType == Reset || styleResolverUpdateType == Recon
struct) { |
| 113 // We should not destroy StyleResolver when we find any stylesheet u
pdate in a shadow tree. | 114 // We should not destroy StyleResolver when we find any stylesheet u
pdate in a shadow tree. |
| 114 // In this case, we will reset rulesets created from style elements
in the shadow tree. | 115 // In this case, we will reset rulesets created from style elements
in the shadow tree. |
| 115 resetAllRuleSetsInTreeScope(styleResolver); | 116 resetAllRuleSetsInTreeScope(styleResolver); |
| 116 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); | 117 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); |
| 117 } else { | 118 } else { |
| 118 ASSERT(styleResolverUpdateType == Additive); | 119 ASSERT(styleResolverUpdateType == Additive); |
| 119 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz
e(), activeCSSStyleSheets); | 120 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz
e(), activeCSSStyleSheets); |
| 120 } | 121 } |
| 121 } | 122 } |
| 122 if (requiresFullStyleRecalc) | 123 if (requiresFullStyleRecalc) |
| 123 toShadowRoot(m_treeScope.rootNode())->host()->setNeedsStyleRecalc(); | 124 toShadowRoot(m_treeScope.rootNode())->host()->setNeedsStyleRecalc(); |
| 124 | 125 |
| 125 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); | 126 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); |
| 126 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); | 127 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); |
| 127 m_styleSheetsForStyleSheetList.swap(styleSheets); | 128 m_styleSheetsForStyleSheetList.swap(styleSheets); |
| 128 updateUsesRemUnits(); | 129 updateUsesRemUnits(); |
| 129 | 130 |
| 130 return requiresFullStyleRecalc; | 131 return requiresFullStyleRecalc; |
| 131 } | 132 } |
| 132 | 133 |
| 133 } | 134 } |
| OLD | NEW |