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

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

Issue 22966004: Revert "Replace style sharing cousin list search with LRU" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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/StyleResolver.h ('k') | Source/core/dom/ContainerNode.cpp » ('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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void StyleResolver::collectFeatures() 236 void StyleResolver::collectFeatures()
237 { 237 {
238 m_features.clear(); 238 m_features.clear();
239 m_ruleSets.collectFeaturesTo(m_features, document()->isViewSource()); 239 m_ruleSets.collectFeaturesTo(m_features, document()->isViewSource());
240 m_styleTree.collectFeaturesTo(m_features); 240 m_styleTree.collectFeaturesTo(m_features);
241 241
242 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); 242 m_siblingRuleSet = makeRuleSet(m_features.siblingRules);
243 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); 243 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules);
244 } 244 }
245 245
246 void StyleResolver::addToStyleSharingList(Element* element)
247 {
248 if (m_styleSharingList.size() >= styleSharingListSize)
249 m_styleSharingList.remove(--m_styleSharingList.end());
250 m_styleSharingList.prepend(element);
251 }
252
253 void StyleResolver::clearStyleSharingList()
254 {
255 m_styleSharingList.clear();
256 }
257
258 void StyleResolver::pushParentElement(Element* parent) 246 void StyleResolver::pushParentElement(Element* parent)
259 { 247 {
260 const ContainerNode* parentsParent = parent->parentOrShadowHostElement(); 248 const ContainerNode* parentsParent = parent->parentOrShadowHostElement();
261 249
262 // We are not always invoked consistently. For example, script execution can cause us to enter 250 // We are not always invoked consistently. For example, script execution can cause us to enter
263 // style recalc in the middle of tree building. We may also be invoked from somewhere within the tree. 251 // style recalc in the middle of tree building. We may also be invoked from somewhere within the tree.
264 // Reset the stack in this case, or if we see a new root element. 252 // Reset the stack in this case, or if we see a new root element.
265 // Otherwise just push the new parent. 253 // Otherwise just push the new parent.
266 if (!parentsParent || m_selectorFilter.parentStackIsEmpty()) 254 if (!parentsParent || m_selectorFilter.parentStackIsEmpty())
267 m_selectorFilter.setupParentStack(parent); 255 m_selectorFilter.setupParentStack(parent);
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che); 1536 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa che);
1549 1537
1550 fprintf(stderr, "Total:\n"); 1538 fprintf(stderr, "Total:\n");
1551 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, 1539 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing,
1552 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache); 1540 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch edPropertiesEnteredIntoCache);
1553 fprintf(stderr, "----------------------------------------------------------- ---------------------\n"); 1541 fprintf(stderr, "----------------------------------------------------------- ---------------------\n");
1554 } 1542 }
1555 #endif 1543 #endif
1556 1544
1557 } // namespace WebCore 1545 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698