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

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

Issue 2509593002: Implement ::placeholder CSS selector. (Closed)
Patch Set: Introduce PseudoType::PseudoPlaceholder Created 4 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ASSERT(matchRequest.ruleSet); 189 ASSERT(matchRequest.ruleSet);
190 ASSERT(m_context.element()); 190 ASSERT(m_context.element());
191 191
192 Element& element = *m_context.element(); 192 Element& element = *m_context.element();
193 const AtomicString& pseudoId = element.shadowPseudoId(); 193 const AtomicString& pseudoId = element.shadowPseudoId();
194 if (!pseudoId.isEmpty()) { 194 if (!pseudoId.isEmpty()) {
195 ASSERT(element.isStyledElement()); 195 ASSERT(element.isStyledElement());
196 collectMatchingRulesForList( 196 collectMatchingRulesForList(
197 matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), cascadeOrder, 197 matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), cascadeOrder,
198 matchRequest); 198 matchRequest);
199 collectMatchingRulesForList(matchRequest.ruleSet->placeholderPseudoRules(),
200 cascadeOrder, matchRequest);
rune 2016/11/21 08:52:33 This means we'll try to match ::placeholder rules
tkent 2016/11/21 09:23:39 Oh, that's right. Fixed.
199 } 201 }
200 202
201 if (element.isVTTElement()) 203 if (element.isVTTElement())
202 collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), 204 collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(),
203 cascadeOrder, matchRequest); 205 cascadeOrder, matchRequest);
204 // Check whether other types of rules are applicable in the current tree 206 // Check whether other types of rules are applicable in the current tree
205 // scope. Criteria for this: 207 // scope. Criteria for this:
206 // a) the rules are UA rules. 208 // a) the rules are UA rules.
207 // b) matching tree boundary crossing rules. 209 // b) matching tree boundary crossing rules.
208 // c) the rules come from a shadow style sheet in the same tree scope as the 210 // c) the rules come from a shadow style sheet in the same tree scope as the
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return !m_matchedRules.isEmpty(); 373 return !m_matchedRules.isEmpty();
372 } 374 }
373 375
374 void ElementRuleCollector::addMatchedRulesToTracker( 376 void ElementRuleCollector::addMatchedRulesToTracker(
375 StyleRuleUsageTracker* tracker) const { 377 StyleRuleUsageTracker* tracker) const {
376 for (auto matchedRule : m_matchedRules) 378 for (auto matchedRule : m_matchedRules)
377 tracker->track(matchedRule.ruleData()->rule()); 379 tracker->track(matchedRule.ruleData()->rule());
378 } 380 }
379 381
380 } // namespace blink 382 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698