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

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

Issue 2509593002: Implement ::placeholder CSS selector. (Closed)
Patch Set: <!DOCTYPE html> 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 if (pseudoId == "-webkit-input-placeholder") {
200 collectMatchingRulesForList(
201 matchRequest.ruleSet->placeholderPseudoRules(), cascadeOrder,
202 matchRequest);
203 }
199 } 204 }
200 205
201 if (element.isVTTElement()) 206 if (element.isVTTElement())
202 collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), 207 collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(),
203 cascadeOrder, matchRequest); 208 cascadeOrder, matchRequest);
204 // Check whether other types of rules are applicable in the current tree 209 // Check whether other types of rules are applicable in the current tree
205 // scope. Criteria for this: 210 // scope. Criteria for this:
206 // a) the rules are UA rules. 211 // a) the rules are UA rules.
207 // b) matching tree boundary crossing rules. 212 // b) matching tree boundary crossing rules.
208 // c) the rules come from a shadow style sheet in the same tree scope as the 213 // 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(); 376 return !m_matchedRules.isEmpty();
372 } 377 }
373 378
374 void ElementRuleCollector::addMatchedRulesToTracker( 379 void ElementRuleCollector::addMatchedRulesToTracker(
375 StyleRuleUsageTracker* tracker) const { 380 StyleRuleUsageTracker* tracker) const {
376 for (auto matchedRule : m_matchedRules) 381 for (auto matchedRule : m_matchedRules)
377 tracker->track(matchedRule.ruleData()->rule()); 382 tracker->track(matchedRule.ruleData()->rule());
378 } 383 }
379 384
380 } // namespace blink 385 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelector.cpp ('k') | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698