OLD | NEW |
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void StyleResolver::collectFeatures() | 235 void StyleResolver::collectFeatures() |
236 { | 236 { |
237 m_features.clear(); | 237 m_features.clear(); |
238 m_ruleSets.collectFeaturesTo(m_features, document().isViewSource()); | 238 m_ruleSets.collectFeaturesTo(m_features, document().isViewSource()); |
239 m_styleTree.collectFeaturesTo(m_features); | 239 m_styleTree.collectFeaturesTo(m_features); |
240 | 240 |
241 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); | 241 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); |
242 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); | 242 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); |
243 } | 243 } |
244 | 244 |
245 void StyleResolver::addToStyleSharingList(Element* element) | |
246 { | |
247 if (m_styleSharingList.size() >= styleSharingListSize) | |
248 m_styleSharingList.remove(--m_styleSharingList.end()); | |
249 m_styleSharingList.prepend(element); | |
250 } | |
251 | |
252 void StyleResolver::clearStyleSharingList() | |
253 { | |
254 m_styleSharingList.clear(); | |
255 } | |
256 | |
257 void StyleResolver::pushParentElement(Element* parent) | 245 void StyleResolver::pushParentElement(Element* parent) |
258 { | 246 { |
259 ASSERT(parent); | 247 ASSERT(parent); |
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()) |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties
SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa
che); | 1514 m_matchedPropertiesSearches, m_matchedPropertiesHit, m_matchedProperties
SharedInheritedHit, m_matchedPropertiesToCache, m_matchedPropertiesEnteredIntoCa
che); |
1527 | 1515 |
1528 fprintf(stderr, "Total:\n"); | 1516 fprintf(stderr, "Total:\n"); |
1529 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS
tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, | 1517 printStyleStats(m_totalSearches, m_totalElementsEligibleForSharing, m_totalS
tylesShared, m_totalSearchFoundSiblingForSharing, m_totalSearchesMissedSharing, |
1530 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa
tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch
edPropertiesEnteredIntoCache); | 1518 m_totalMatchedPropertiesSearches, m_totalMatchedPropertiesHit, m_totalMa
tchedPropertiesSharedInheritedHit, m_totalMatchedPropertiesToCache, m_totalMatch
edPropertiesEnteredIntoCache); |
1531 fprintf(stderr, "-----------------------------------------------------------
---------------------\n"); | 1519 fprintf(stderr, "-----------------------------------------------------------
---------------------\n"); |
1532 } | 1520 } |
1533 #endif | 1521 #endif |
1534 | 1522 |
1535 } // namespace WebCore | 1523 } // namespace WebCore |
OLD | NEW |