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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSSelectorList.cpp

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 5 years 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) 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return selector.relationIsAffectedByPseudoContent(); 168 return selector.relationIsAffectedByPseudoContent();
169 } 169 }
170 }; 170 };
171 171
172 bool CSSSelectorList::selectorHasShadowDistributed(size_t index) const 172 bool CSSSelectorList::selectorHasShadowDistributed(size_t index) const
173 { 173 {
174 SelectorHasShadowDistributed functor; 174 SelectorHasShadowDistributed functor;
175 return forEachTagSelector(functor, selectorAt(index)); 175 return forEachTagSelector(functor, selectorAt(index));
176 } 176 }
177 177
178 class SelectorHasShadowSlotted {
179 public:
180 bool operator()(const CSSSelector& selector)
181 {
182 return selector.relationIsAffectedByPseudoSlotted();
183 }
184 };
185
186 bool CSSSelectorList::selectorHasShadowSlotted(size_t index) const
187 {
188 SelectorHasShadowSlotted functor;
189 return forEachTagSelector(functor, selectorAt(index));
190 }
191
178 class SelectorUsesDeepCombinatorOrShadowPseudo { 192 class SelectorUsesDeepCombinatorOrShadowPseudo {
179 public: 193 public:
180 bool operator()(const CSSSelector& selector) 194 bool operator()(const CSSSelector& selector)
181 { 195 {
182 return selector.relation() == CSSSelector::ShadowDeep || selector.pseudo Type() == CSSSelector::PseudoShadow; 196 return selector.relation() == CSSSelector::ShadowDeep || selector.pseudo Type() == CSSSelector::PseudoShadow;
183 } 197 }
184 }; 198 };
185 199
186 bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) con st 200 bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) con st
187 { 201 {
188 SelectorUsesDeepCombinatorOrShadowPseudo functor; 202 SelectorUsesDeepCombinatorOrShadowPseudo functor;
189 return forEachTagSelector(functor, selectorAt(index)); 203 return forEachTagSelector(functor, selectorAt(index));
190 } 204 }
191 205
192 class SelectorNeedsUpdatedDistribution { 206 class SelectorNeedsUpdatedDistribution {
193 public: 207 public:
194 bool operator()(const CSSSelector& selector) 208 bool operator()(const CSSSelector& selector)
195 { 209 {
196 return selector.relationIsAffectedByPseudoContent() || selector.pseudoTy pe() == CSSSelector::PseudoHostContext; 210 return selector.relationIsAffectedByPseudoContent() || selector.pseudoTy pe() == CSSSelector::PseudoHostContext || selector.pseudoType() == CSSSelector:: PseudoSlotted;
197 } 211 }
198 }; 212 };
199 213
200 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const 214 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const
201 { 215 {
202 SelectorNeedsUpdatedDistribution functor; 216 SelectorNeedsUpdatedDistribution functor;
203 return forEachTagSelector(functor, selectorAt(index)); 217 return forEachTagSelector(functor, selectorAt(index));
204 } 218 }
205 219
206 } // namespace blink 220 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698