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

Side by Side Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (!isHTMLContentElement(*element)) 324 if (!isHTMLContentElement(*element))
325 continue; 325 continue;
326 const CSSSelectorList& list = toHTMLContentElement(*element).selectorLis t(); 326 const CSSSelectorList& list = toHTMLContentElement(*element).selectorLis t();
327 for (const CSSSelector* selector = list.first(); selector; selector = CS SSelectorList::next(*selector)) { 327 for (const CSSSelector* selector = list.first(); selector; selector = CS SSelectorList::next(*selector)) {
328 for (const CSSSelector* component = selector; component; component = component->tagHistory()) 328 for (const CSSSelector* component = selector; component; component = component->tagHistory())
329 m_selectFeatures.collectFeaturesFromSelector(*component); 329 m_selectFeatures.collectFeaturesFromSelector(*component);
330 } 330 }
331 } 331 }
332 } 332 }
333 333
334 void ElementShadow::didAffectSelector(AffectedSelectorMask mask) 334 void ElementShadow::distributedNodePseudoStateChanged(CSSSelector::PseudoType ps eudo)
335 { 335 {
336 if (ensureSelectFeatureSet().hasSelectorFor(mask)) 336 if (ensureSelectFeatureSet().hasSelectorForPseudoType(pseudo))
337 setNeedsDistributionRecalc(); 337 setNeedsDistributionRecalc();
338 } 338 }
339 339
340 void ElementShadow::willAffectSelector() 340 void ElementShadow::willAffectSelector()
341 { 341 {
342 for (ElementShadow* shadow = this; shadow; shadow = shadow->containingShadow ()) { 342 for (ElementShadow* shadow = this; shadow; shadow = shadow->containingShadow ()) {
343 if (shadow->needsSelectFeatureSet()) 343 if (shadow->needsSelectFeatureSet())
344 break; 344 break;
345 shadow->setNeedsSelectFeatureSet(); 345 shadow->setNeedsSelectFeatureSet();
346 } 346 }
(...skipping 14 matching lines...) Expand all
361 visitor->trace(m_nodeToInsertionPoints); 361 visitor->trace(m_nodeToInsertionPoints);
362 visitor->trace(m_selectFeatures); 362 visitor->trace(m_selectFeatures);
363 // Shadow roots are linked with previous and next pointers which are traced. 363 // Shadow roots are linked with previous and next pointers which are traced.
364 // It is therefore enough to trace one of the shadow roots here and the 364 // It is therefore enough to trace one of the shadow roots here and the
365 // rest will be traced from there. 365 // rest will be traced from there.
366 visitor->trace(m_shadowRoots.head()); 366 visitor->trace(m_shadowRoots.head());
367 #endif 367 #endif
368 } 368 }
369 369
370 } // namespace 370 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698