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

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

Issue 1565263003: Implement CSS parser part for ::slotted pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix layout test. Created 4 years, 11 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) 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool CSSSelectorList::selectorsNeedNamespaceResolution() 154 bool CSSSelectorList::selectorsNeedNamespaceResolution()
155 { 155 {
156 return forEachSelector([](const CSSSelector& selector) -> bool { 156 return forEachSelector([](const CSSSelector& selector) -> bool {
157 if (selector.match() != CSSSelector::Tag && !selector.isAttributeSelecto r()) 157 if (selector.match() != CSSSelector::Tag && !selector.isAttributeSelecto r())
158 return false; 158 return false;
159 const AtomicString& prefix = selector.isAttributeSelector() ? selector.a ttribute().prefix() : selector.tagQName().prefix(); 159 const AtomicString& prefix = selector.isAttributeSelector() ? selector.a ttribute().prefix() : selector.tagQName().prefix();
160 return prefix != nullAtom && prefix != emptyAtom && prefix != starAtom; 160 return prefix != nullAtom && prefix != emptyAtom && prefix != starAtom;
161 }, this); 161 }, this);
162 } 162 }
163 163
164 bool CSSSelectorList::selectorHasShadowDistributed(size_t index) const 164 bool CSSSelectorList::selectorHasContentPseudo(size_t index) const
165 { 165 {
166 return forEachTagSelector([](const CSSSelector& selector) -> bool { 166 return forEachTagSelector([](const CSSSelector& selector) -> bool {
167 return selector.relationIsAffectedByPseudoContent(); 167 return selector.relationIsAffectedByPseudoContent();
168 }, selectorAt(index)); 168 }, selectorAt(index));
169 } 169 }
170 170
171 bool CSSSelectorList::selectorHasSlottedPseudo(size_t index) const
172 {
173 return forEachTagSelector([](const CSSSelector& selector) -> bool {
174 return selector.pseudoType() == CSSSelector::PseudoSlotted;
175 }, selectorAt(index));
176 }
177
171 bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) con st 178 bool CSSSelectorList::selectorUsesDeepCombinatorOrShadowPseudo(size_t index) con st
172 { 179 {
173 return forEachTagSelector([](const CSSSelector& selector) -> bool { 180 return forEachTagSelector([](const CSSSelector& selector) -> bool {
174 return selector.relation() == CSSSelector::ShadowDeep || selector.pseudo Type() == CSSSelector::PseudoShadow; 181 return selector.relation() == CSSSelector::ShadowDeep || selector.pseudo Type() == CSSSelector::PseudoShadow;
175 }, selectorAt(index)); 182 }, selectorAt(index));
176 } 183 }
177 184
178 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const 185 bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const
179 { 186 {
180 return forEachTagSelector([](const CSSSelector& selector) -> bool { 187 return forEachTagSelector([](const CSSSelector& selector) -> bool {
181 return selector.relationIsAffectedByPseudoContent() || selector.pseudoTy pe() == CSSSelector::PseudoHostContext; 188 return selector.relationIsAffectedByPseudoContent() || selector.pseudoTy pe() == CSSSelector::PseudoHostContext;
182 }, selectorAt(index)); 189 }, selectorAt(index));
183 } 190 }
184 191
185 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | third_party/WebKit/Source/core/css/RuleSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698