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

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

Issue 1683923003: Don't add siblingRules with combinator left of ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing clear Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.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 * 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation Type); 101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation Type);
102 102
103 private: 103 private:
104 // Each map entry is either a DescendantInvalidationSet or SiblingInvalidati onSet. 104 // Each map entry is either a DescendantInvalidationSet or SiblingInvalidati onSet.
105 // When both are needed, we store the SiblingInvalidationSet, and use it to hold the DescendantInvalidationSet. 105 // When both are needed, we store the SiblingInvalidationSet, and use it to hold the DescendantInvalidationSet.
106 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationSet>>; 106 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationSet>>;
107 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr <InvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<un signed>>; 107 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr <InvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<un signed>>;
108 108
109 struct FeatureMetadata { 109 struct FeatureMetadata {
110 DISALLOW_NEW(); 110 DISALLOW_NEW();
111 FeatureMetadata()
112 : usesFirstLineRules(false)
113 , usesWindowInactiveSelector(false)
114 , foundSiblingSelector(false)
115 , maxDirectAdjacentSelectors(0)
116 { }
117 void add(const FeatureMetadata& other); 111 void add(const FeatureMetadata& other);
118 void clear(); 112 void clear();
119 113
120 bool usesFirstLineRules; 114 bool usesFirstLineRules = false;
121 bool usesWindowInactiveSelector; 115 bool usesWindowInactiveSelector = false;
122 bool foundSiblingSelector; 116 bool foundSiblingSelector = false;
123 unsigned maxDirectAdjacentSelectors; 117 bool foundInsertionPointCrossing = false;
118 unsigned maxDirectAdjacentSelectors = 0;
124 }; 119 };
125 120
126 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&); 121 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&);
127 122
128 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType); 123 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType);
129 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType); 124 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType);
130 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType); 125 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType);
131 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali dationType); 126 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali dationType);
132 127
133 void updateInvalidationSets(const RuleData&); 128 void updateInvalidationSets(const RuleData&);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 164 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
170 165
171 friend class RuleFeatureSetTest; 166 friend class RuleFeatureSetTest;
172 }; 167 };
173 168
174 } // namespace blink 169 } // namespace blink
175 170
176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); 171 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature);
177 172
178 #endif // RuleFeature_h 173 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698