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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, styleResolverUpdateType, requiresFullStyleRecalc); | 106 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl
eSheets, styleResolverUpdateType, requiresFullStyleRecalc); |
107 | 107 |
108 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { | 108 if (StyleResolver* styleResolver = document()->styleResolverIfExists()) { |
109 // FIXME: We might have already had styles in child treescope. In this c
ase, we cannot use buildScopedStyleTreeInDocumentOrder. | 109 // 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. | 110 // Need to change "false" to some valid condition. |
111 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); | 111 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); |
112 if (styleResolverUpdateType == Reset || styleResolverUpdateType == Recon
struct) { | 112 if (styleResolverUpdateType == Reset || styleResolverUpdateType == Recon
struct) { |
113 // We should not destroy StyleResolver when we find any stylesheet u
pdate in a shadow tree. | 113 // 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. | 114 // In this case, we will reset rulesets created from style elements
in the shadow tree. |
115 resetAllRuleSetsInTreeScope(styleResolver); | 115 resetAllRuleSetsInTreeScope(styleResolver); |
116 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); | 116 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe
ets); |
| 117 styleResolver->lazyAppendAuthorStyleSheets(0, activeCSSStyleSheets); |
117 } else { | 118 } else { |
118 ASSERT(styleResolverUpdateType == Additive); | 119 ASSERT(styleResolverUpdateType == Additive); |
119 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz
e(), activeCSSStyleSheets); | 120 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets
.size(), 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 |