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

Side by Side Diff: Source/core/css/RuleFeature.cpp

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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
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 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS elector& selector) 206 DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS elector& selector)
207 { 207 {
208 if (selector.match() == CSSSelector::Class) 208 if (selector.match() == CSSSelector::Class)
209 return &ensureClassInvalidationSet(selector.value()); 209 return &ensureClassInvalidationSet(selector.value());
210 if (selector.isAttributeSelector()) 210 if (selector.isAttributeSelector())
211 return &ensureAttributeInvalidationSet(selector.attribute().localName()) ; 211 return &ensureAttributeInvalidationSet(selector.attribute().localName()) ;
212 if (selector.match() == CSSSelector::Id) 212 if (selector.match() == CSSSelector::Id)
213 return &ensureIdInvalidationSet(selector.value()); 213 return &ensureIdInvalidationSet(selector.value());
214 if (selector.match() == CSSSelector::PseudoClass) { 214 if (selector.match() == CSSSelector::PseudoClass) {
215 CSSSelector::PseudoType pseudo = selector.pseudoType(); 215 switch (selector.pseudoType()) {
216 if (pseudo == CSSSelector::PseudoHover || pseudo == CSSSelector::PseudoA ctive || pseudo == CSSSelector::PseudoFocus) 216 case CSSSelector::PseudoHover:
217 return &ensurePseudoInvalidationSet(pseudo); 217 case CSSSelector::PseudoActive:
218 case CSSSelector::PseudoFocus:
219 case CSSSelector::PseudoChecked:
220 case CSSSelector::PseudoEnabled:
221 case CSSSelector::PseudoDisabled:
222 case CSSSelector::PseudoIndeterminate:
223 case CSSSelector::PseudoLink:
224 case CSSSelector::PseudoTarget:
225 case CSSSelector::PseudoVisited:
226 return &ensurePseudoInvalidationSet(selector.pseudoType());
227 default:
228 break;
229 }
218 } 230 }
219 return 0; 231 return 0;
220 } 232 }
221 233
222 // Given a selector, update the descendant invalidation sets for the features fo und 234 // Given a selector, update the descendant invalidation sets for the features fo und
223 // in the selector. The first step is to extract the features from the rightmost 235 // in the selector. The first step is to extract the features from the rightmost
224 // compound selector (extractInvalidationSetFeatures). Secondly, those features will be 236 // compound selector (extractInvalidationSetFeatures). Secondly, those features will be
225 // added to the invalidation sets for the features found in the other compound s electors 237 // added to the invalidation sets for the features found in the other compound s electors
226 // (addFeaturesToInvalidationSets). 238 // (addFeaturesToInvalidationSets).
227 239
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 visitor->trace(uncommonAttributeRules); 572 visitor->trace(uncommonAttributeRules);
561 visitor->trace(m_classInvalidationSets); 573 visitor->trace(m_classInvalidationSets);
562 visitor->trace(m_attributeInvalidationSets); 574 visitor->trace(m_attributeInvalidationSets);
563 visitor->trace(m_idInvalidationSets); 575 visitor->trace(m_idInvalidationSets);
564 visitor->trace(m_pseudoInvalidationSets); 576 visitor->trace(m_pseudoInvalidationSets);
565 visitor->trace(m_styleInvalidator); 577 visitor->trace(m_styleInvalidator);
566 #endif 578 #endif
567 } 579 }
568 580
569 } // namespace blink 581 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698