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

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

Issue 2509593002: Implement ::placeholder CSS selector. (Closed)
Patch Set: Test fix, etc. 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 Apple Inc. All 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All
6 * rights reserved. 6 * 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 m_cuePseudoRules.append(ruleData); 213 m_cuePseudoRules.append(ruleData);
214 return true; 214 return true;
215 case CSSSelector::PseudoLink: 215 case CSSSelector::PseudoLink:
216 case CSSSelector::PseudoVisited: 216 case CSSSelector::PseudoVisited:
217 case CSSSelector::PseudoAnyLink: 217 case CSSSelector::PseudoAnyLink:
218 m_linkPseudoClassRules.append(ruleData); 218 m_linkPseudoClassRules.append(ruleData);
219 return true; 219 return true;
220 case CSSSelector::PseudoFocus: 220 case CSSSelector::PseudoFocus:
221 m_focusPseudoClassRules.append(ruleData); 221 m_focusPseudoClassRules.append(ruleData);
222 return true; 222 return true;
223 case CSSSelector::PseudoPlaceholder:
224 m_placeholderPseudoRules.append(ruleData);
225 return true;
223 default: 226 default:
224 break; 227 break;
225 } 228 }
226 229
227 if (!tagName.isEmpty()) { 230 if (!tagName.isEmpty()) {
228 addToRuleSet(tagName, ensurePendingRules()->tagRules, ruleData); 231 addToRuleSet(tagName, ensurePendingRules()->tagRules, ruleData);
229 return true; 232 return true;
230 } 233 }
231 234
232 if (component.isHostPseudoClass()) { 235 if (component.isHostPseudoClass()) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ASSERT(m_pendingRules); 367 ASSERT(m_pendingRules);
365 PendingRuleMaps* pendingRules = m_pendingRules.release(); 368 PendingRuleMaps* pendingRules = m_pendingRules.release();
366 compactPendingRules(pendingRules->idRules, m_idRules); 369 compactPendingRules(pendingRules->idRules, m_idRules);
367 compactPendingRules(pendingRules->classRules, m_classRules); 370 compactPendingRules(pendingRules->classRules, m_classRules);
368 compactPendingRules(pendingRules->tagRules, m_tagRules); 371 compactPendingRules(pendingRules->tagRules, m_tagRules);
369 compactPendingRules(pendingRules->shadowPseudoElementRules, 372 compactPendingRules(pendingRules->shadowPseudoElementRules,
370 m_shadowPseudoElementRules); 373 m_shadowPseudoElementRules);
371 m_linkPseudoClassRules.shrinkToFit(); 374 m_linkPseudoClassRules.shrinkToFit();
372 m_cuePseudoRules.shrinkToFit(); 375 m_cuePseudoRules.shrinkToFit();
373 m_focusPseudoClassRules.shrinkToFit(); 376 m_focusPseudoClassRules.shrinkToFit();
377 m_placeholderPseudoRules.shrinkToFit();
374 m_universalRules.shrinkToFit(); 378 m_universalRules.shrinkToFit();
375 m_shadowHostRules.shrinkToFit(); 379 m_shadowHostRules.shrinkToFit();
376 m_pageRules.shrinkToFit(); 380 m_pageRules.shrinkToFit();
377 m_fontFaceRules.shrinkToFit(); 381 m_fontFaceRules.shrinkToFit();
378 m_keyframesRules.shrinkToFit(); 382 m_keyframesRules.shrinkToFit();
379 m_deepCombinatorOrShadowPseudoRules.shrinkToFit(); 383 m_deepCombinatorOrShadowPseudoRules.shrinkToFit();
380 m_contentPseudoElementRules.shrinkToFit(); 384 m_contentPseudoElementRules.shrinkToFit();
381 m_slottedPseudoElementRules.shrinkToFit(); 385 m_slottedPseudoElementRules.shrinkToFit();
382 } 386 }
383 387
(...skipping 13 matching lines...) Expand all
397 } 401 }
398 402
399 DEFINE_TRACE(RuleSet) { 403 DEFINE_TRACE(RuleSet) {
400 visitor->trace(m_idRules); 404 visitor->trace(m_idRules);
401 visitor->trace(m_classRules); 405 visitor->trace(m_classRules);
402 visitor->trace(m_tagRules); 406 visitor->trace(m_tagRules);
403 visitor->trace(m_shadowPseudoElementRules); 407 visitor->trace(m_shadowPseudoElementRules);
404 visitor->trace(m_linkPseudoClassRules); 408 visitor->trace(m_linkPseudoClassRules);
405 visitor->trace(m_cuePseudoRules); 409 visitor->trace(m_cuePseudoRules);
406 visitor->trace(m_focusPseudoClassRules); 410 visitor->trace(m_focusPseudoClassRules);
411 visitor->trace(m_placeholderPseudoRules);
407 visitor->trace(m_universalRules); 412 visitor->trace(m_universalRules);
408 visitor->trace(m_shadowHostRules); 413 visitor->trace(m_shadowHostRules);
409 visitor->trace(m_features); 414 visitor->trace(m_features);
410 visitor->trace(m_pageRules); 415 visitor->trace(m_pageRules);
411 visitor->trace(m_fontFaceRules); 416 visitor->trace(m_fontFaceRules);
412 visitor->trace(m_keyframesRules); 417 visitor->trace(m_keyframesRules);
413 visitor->trace(m_deepCombinatorOrShadowPseudoRules); 418 visitor->trace(m_deepCombinatorOrShadowPseudoRules);
414 visitor->trace(m_contentPseudoElementRules); 419 visitor->trace(m_contentPseudoElementRules);
415 visitor->trace(m_slottedPseudoElementRules); 420 visitor->trace(m_slottedPseudoElementRules);
416 visitor->trace(m_viewportDependentMediaQueryResults); 421 visitor->trace(m_viewportDependentMediaQueryResults);
417 visitor->trace(m_deviceDependentMediaQueryResults); 422 visitor->trace(m_deviceDependentMediaQueryResults);
418 visitor->trace(m_pendingRules); 423 visitor->trace(m_pendingRules);
419 #ifndef NDEBUG 424 #ifndef NDEBUG
420 visitor->trace(m_allRules); 425 visitor->trace(m_allRules);
421 #endif 426 #endif
422 } 427 }
423 428
424 #ifndef NDEBUG 429 #ifndef NDEBUG
425 void RuleSet::show() const { 430 void RuleSet::show() const {
426 for (const auto& rule : m_allRules) 431 for (const auto& rule : m_allRules)
427 rule.selector().show(); 432 rule.selector().show();
428 } 433 }
429 #endif 434 #endif
430 435
431 } // namespace blink 436 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698