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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 activeSheets.append(activeSheet); | 90 activeSheets.append(activeSheet); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 bool ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collec
tions, StyleResolverUpdateMode updateMode) | 94 bool ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collec
tions, StyleResolverUpdateMode updateMode) |
95 { | 95 { |
96 Vector<RefPtr<StyleSheet> > styleSheets; | 96 Vector<RefPtr<StyleSheet> > styleSheets; |
97 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; | 97 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; |
98 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); | 98 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); |
99 | 99 |
100 bool requiresFullStyleRecalc = true; | 100 StyleSheetChange change; |
101 | 101 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, change); |
102 StyleResolverUpdateType styleResolverUpdateType; | |
103 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, styleResolverUpdateType, requiresFullStyleRecalc); | |
104 | 102 |
105 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { | 103 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { |
106 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. | 104 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. |
107 // Need to change "false" to some valid condition. | 105 // Need to change "false" to some valid condition. |
108 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); | 106 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); |
109 if (styleResolverUpdateType == Reset || styleResolverUpdateType == Recon
struct) { | 107 if (change.styleResolverUpdateType != Additive) { |
110 // We should not destroy StyleResolver when we find any stylesheet u
pdate in a shadow tree. | 108 // We should not destroy StyleResolver when we find any stylesheet u
pdate in a shadow tree. |
111 // In this case, we will reset rulesets created from style elements
in the shadow tree. | 109 // In this case, we will reset rulesets created from style elements
in the shadow tree. |
112 resetAllRuleSetsInTreeScope(styleResolver); | 110 resetAllRuleSetsInTreeScope(styleResolver); |
113 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); | 111 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); |
114 } else { | 112 } else { |
115 ASSERT(styleResolverUpdateType == Additive); | |
116 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz
e(), activeCSSStyleSheets); | 113 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz
e(), activeCSSStyleSheets); |
117 } | 114 } |
118 } | 115 } |
119 if (requiresFullStyleRecalc) | 116 if (change.requiresFullStyleRecalc) |
120 toShadowRoot(m_treeScope.rootNode())->host()->setNeedsStyleRecalc(); | 117 toShadowRoot(m_treeScope.rootNode())->host()->setNeedsStyleRecalc(); |
121 | 118 |
122 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); | 119 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); |
123 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); | 120 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); |
124 m_styleSheetsForStyleSheetList.swap(styleSheets); | 121 m_styleSheetsForStyleSheetList.swap(styleSheets); |
125 updateUsesRemUnits(); | 122 updateUsesRemUnits(); |
126 | 123 |
127 return requiresFullStyleRecalc; | 124 return change.requiresFullStyleRecalc; |
128 } | 125 } |
129 | 126 |
130 } | 127 } |
OLD | NEW |