Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 collectFeatures(); 204 collectFeatures();
205 205
206 if (document().renderer() && document().renderer()->style()) 206 if (document().renderer() && document().renderer()->style())
207 document().renderer()->style()->font().update(fontSelector()); 207 document().renderer()->style()->font().update(fontSelector());
208 208
209 collectViewportRules(); 209 collectViewportRules();
210 } 210 }
211 211
212 void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode) 212 void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode)
213 { 213 {
214 ScopedStyleResolver* resolver = scopingNode ? m_styleTree.scopedStyleResolve rFor(*scopingNode) : m_styleTree.scopedStyleResolverForDocument(); 214 // FIXME: When chanking scoped attribute, scopingNode's hasScopedHTMLStyleCh ild has been already modified.
eseidel 2013/10/17 15:53:11 "changing" I think.
215 // So we cannot use hasScopedHTMLStyleChild flag here.
216 ScopedStyleResolver* resolver = scopingNode ? m_styleTree.lookupScopedStyleR esolverFor(scopingNode) : m_styleTree.scopedStyleResolverForDocument();
215 if (!resolver) 217 if (!resolver)
216 return; 218 return;
217 219
218 m_ruleSets.shadowDistributedRules().reset(scopingNode); 220 m_ruleSets.shadowDistributedRules().reset(scopingNode);
219 221
220 resolver->resetAuthorStyle(); 222 resolver->resetAuthorStyle();
221 if (!scopingNode) 223 if (!scopingNode)
222 return; 224 return;
223 225
224 if (scopingNode->isShadowRoot()) 226 if (scopingNode->isShadowRoot())
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che); 1636 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che);
1635 1637
1636 fprintf(stderr, "Total:\n"); 1638 fprintf(stderr, "Total:\n");
1637 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, 1639 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing,
1638 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache); 1640 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache);
1639 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); 1641 fprintf(stderr, "----------------------------------------------------------- ---------------------\n");
1640 } 1642 }
1641 #endif 1643 #endif
1642 1644
1643 } // namespace WebCore 1645 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698