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

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

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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 void collectFeaturesFromSelector(const CSSSelector&); 61 void collectFeaturesFromSelector(const CSSSelector&);
62 void collectFeaturesFromRuleData(const RuleData&); 62 void collectFeaturesFromRuleData(const RuleData&);
63 63
64 bool usesSiblingRules() const { return !siblingRules.isEmpty(); } 64 bool usesSiblingRules() const { return !siblingRules.isEmpty(); }
65 bool usesFirstLineRules() const { return m_metadata.usesFirstLineRules; } 65 bool usesFirstLineRules() const { return m_metadata.usesFirstLineRules; }
66 66
67 unsigned maxDirectAdjacentSelectors() const { return m_metadata.maxDirectAdj acentSelectors; } 67 unsigned maxDirectAdjacentSelectors() const { return m_metadata.maxDirectAdj acentSelectors; }
68 void setMaxDirectAdjacentSelectors(unsigned value) { m_metadata.maxDirectAd jacentSelectors = std::max(value, m_metadata.maxDirectAdjacentSelectors); } 68 void setMaxDirectAdjacentSelectors(unsigned value) { m_metadata.maxDirectAd jacentSelectors = std::max(value, m_metadata.maxDirectAdjacentSelectors); }
69 69
70 inline bool hasSelectorForAttribute(const AtomicString& attributeName) const 70 bool hasSelectorForAttribute(const AtomicString& attributeName) const
71 { 71 {
72 ASSERT(!attributeName.isEmpty()); 72 ASSERT(!attributeName.isEmpty());
73 return m_attributeInvalidationSets.contains(attributeName); 73 return m_attributeInvalidationSets.contains(attributeName);
74 } 74 }
75 75
76 inline bool hasSelectorForClass(const AtomicString& classValue) const 76 bool hasSelectorForClass(const AtomicString& classValue) const
77 { 77 {
78 ASSERT(!classValue.isEmpty()); 78 ASSERT(!classValue.isEmpty());
79 return m_classInvalidationSets.contains(classValue); 79 return m_classInvalidationSets.contains(classValue);
80 } 80 }
81 81
82 inline bool hasSelectorForId(const AtomicString& idValue) const 82 bool hasSelectorForId(const AtomicString& idValue) const { return m_idInvali dationSets.contains(idValue); }
83 { 83 bool hasSelectorForPseudoType(CSSSelector::PseudoType pseudo) const { return m_pseudoInvalidationSets.contains(pseudo); }
84 return m_idInvalidationSets.contains(idValue);
85 }
86 84
87 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed Classes, Element&); 85 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed Classes, Element&);
88 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas ses, const SpaceSplitString& newClasses, Element&); 86 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas ses, const SpaceSplitString& newClasses, Element&);
89 void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attrib uteName, Element&); 87 void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attrib uteName, Element&);
90 void scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const A tomicString& newId, Element&); 88 void scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const A tomicString& newId, Element&);
91 void scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoType, Eleme nt&); 89 void scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoType, Eleme nt&);
92 90
93 bool hasIdsInSelectors() const 91 bool hasIdsInSelectors() const
94 { 92 {
95 return m_idInvalidationSets.size() > 0; 93 return m_idInvalidationSets.size() > 0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 178
181 template <> struct VectorTraits<blink::RuleFeature> : VectorTraitsBase<blink::Ru leFeature> { 179 template <> struct VectorTraits<blink::RuleFeature> : VectorTraitsBase<blink::Ru leFeature> {
182 static const bool needsDestruction = false; 180 static const bool needsDestruction = false;
183 static const bool canInitializeWithMemset = true; 181 static const bool canInitializeWithMemset = true;
184 static const bool canMoveWithMemcpy = true; 182 static const bool canMoveWithMemcpy = true;
185 }; 183 };
186 184
187 } // namespace WTF 185 } // namespace WTF
188 186
189 #endif // RuleFeature_h 187 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/invalidation/visited-pseudo-expected.txt ('k') | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698