OLD | NEW |
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 Loading... |
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 |
OLD | NEW |