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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 if (updateMode != AnalyzedStyleUpdate) | 133 if (updateMode != AnalyzedStyleUpdate) |
134 return; | 134 return; |
135 if (!document()->styleResolverIfExists()) | 135 if (!document()->styleResolverIfExists()) |
136 return; | 136 return; |
137 | 137 |
138 // Find out which stylesheets are new. | 138 // Find out which stylesheets are new. |
139 Vector<StyleSheetContents*> addedSheets; | 139 Vector<StyleSheetContents*> addedSheets; |
140 styleResolverUpdateType = compareStyleSheets(oldStyleSheets, newStyleSheets,
addedSheets); | 140 styleResolverUpdateType = compareStyleSheets(oldStyleSheets, newStyleSheets,
addedSheets); |
141 | 141 |
| 142 // FIXME: If styleResolverUpdateType is still Reconstruct, we could return e
arly here |
| 143 // as destroying the StyleResolver will recalc the whole document anyway? |
| 144 |
142 // If we are already parsing the body and so may have significant amount of
elements, put some effort into trying to avoid style recalcs. | 145 // If we are already parsing the body and so may have significant amount of
elements, put some effort into trying to avoid style recalcs. |
143 if (!document()->body() || document()->hasNodesWithPlaceholderStyle()) | 146 if (!document()->body() || document()->hasNodesWithPlaceholderStyle()) |
144 return; | 147 return; |
145 StyleInvalidationAnalysis invalidationAnalysis(addedSheets); | 148 StyleInvalidationAnalysis invalidationAnalysis(addedSheets); |
146 if (invalidationAnalysis.dirtiesAllStyle()) | 149 if (invalidationAnalysis.dirtiesAllStyle()) |
147 return; | 150 return; |
148 invalidationAnalysis.invalidateStyle(document()); | 151 invalidationAnalysis.invalidateStyle(document()); |
149 requiresFullStyleRecalc = false; | 152 requiresFullStyleRecalc = false; |
150 } | 153 } |
151 | 154 |
(...skipping 19 matching lines...) Expand all Loading... |
171 } | 174 } |
172 return false; | 175 return false; |
173 } | 176 } |
174 | 177 |
175 void StyleSheetCollection::updateUsesRemUnits() | 178 void StyleSheetCollection::updateUsesRemUnits() |
176 { | 179 { |
177 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); | 180 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); |
178 } | 181 } |
179 | 182 |
180 } | 183 } |
OLD | NEW |