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

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

Issue 565493002: Use invalidation set for :empty pseudo changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@empty-flag-20140910
Patch Set: 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::PseudoEmpty:
217 return &ensurePseudoInvalidationSet(pseudo); 217 case CSSSelector::PseudoHover:
218 case CSSSelector::PseudoActive:
219 case CSSSelector::PseudoFocus:
220 return &ensurePseudoInvalidationSet(selector.pseudoType());
221 default:
222 break;
223 }
218 } 224 }
219 return 0; 225 return 0;
220 } 226 }
221 227
222 // Given a selector, update the descendant invalidation sets for the features fo und 228 // 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 229 // in the selector. The first step is to extract the features from the rightmost
224 // compound selector (extractInvalidationSetFeatures). Secondly, those features will be 230 // compound selector (extractInvalidationSetFeatures). Secondly, those features will be
225 // added to the invalidation sets for the features found in the other compound s electors 231 // added to the invalidation sets for the features found in the other compound s electors
226 // (addFeaturesToInvalidationSets). 232 // (addFeaturesToInvalidationSets).
227 233
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 visitor->trace(uncommonAttributeRules); 566 visitor->trace(uncommonAttributeRules);
561 visitor->trace(m_classInvalidationSets); 567 visitor->trace(m_classInvalidationSets);
562 visitor->trace(m_attributeInvalidationSets); 568 visitor->trace(m_attributeInvalidationSets);
563 visitor->trace(m_idInvalidationSets); 569 visitor->trace(m_idInvalidationSets);
564 visitor->trace(m_pseudoInvalidationSets); 570 visitor->trace(m_pseudoInvalidationSets);
565 visitor->trace(m_styleInvalidator); 571 visitor->trace(m_styleInvalidator);
566 #endif 572 #endif
567 } 573 }
568 574
569 } // namespace blink 575 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/invalidation/empty-pseudo-sibling-expected.txt ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698