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

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

Issue 1717703002: Use invalidation sets to invalidate slotted elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed expected text Created 4 years, 10 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) 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 r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } else { 413 } else {
414 if (requiresSubtreeInvalidation(*current)) { 414 if (requiresSubtreeInvalidation(*current)) {
415 // Fall back to use subtree invalidations, even for features in the 415 // Fall back to use subtree invalidations, even for features in the
416 // rightmost compound selector. Returning the start &selector he re 416 // rightmost compound selector. Returning the start &selector he re
417 // will make addFeaturesToInvalidationSets start marking invalid ation 417 // will make addFeaturesToInvalidationSets start marking invalid ation
418 // sets for subtree recalc for features in the rightmost compoun d 418 // sets for subtree recalc for features in the rightmost compoun d
419 // selector. 419 // selector.
420 return std::make_pair(&selector, ForceSubtree); 420 return std::make_pair(&selector, ForceSubtree);
421 } 421 }
422 if (const CSSSelectorList* selectorList = current->selectorList()) { 422 if (const CSSSelectorList* selectorList = current->selectorList()) {
423 if (current->pseudoType() == CSSSelector::PseudoSlotted) {
424 ASSERT(position == Subject);
425 features.invalidatesSlotted = true;
426 }
423 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType( ))); 427 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType( )));
424 const CSSSelector* subSelector = selectorList->first(); 428 const CSSSelector* subSelector = selectorList->first();
425 bool allSubSelectorsHaveFeatures = !!subSelector; 429 bool allSubSelectorsHaveFeatures = !!subSelector;
426 for (; subSelector; subSelector = CSSSelectorList::next(*subSele ctor)) { 430 for (; subSelector; subSelector = CSSSelectorList::next(*subSele ctor)) {
427 auto result = extractInvalidationSetFeatures(*subSelector, f eatures, position, current->pseudoType()); 431 auto result = extractInvalidationSetFeatures(*subSelector, f eatures, position, current->pseudoType());
428 if (result.first) { 432 if (result.first) {
429 // A non-null selector return means the sub-selector con tained a 433 // A non-null selector return means the sub-selector con tained a
430 // selector which requiresSubtreeInvalidation(). Return the rightmost 434 // selector which requiresSubtreeInvalidation(). Return the rightmost
431 // selector to mark for subtree recalcs like above. 435 // selector to mark for subtree recalcs like above.
432 return std::make_pair(&selector, ForceSubtree); 436 return std::make_pair(&selector, ForceSubtree);
(...skipping 28 matching lines...) Expand all
461 // As we encounter a descendant type of combinator, the features only need to be checked 465 // As we encounter a descendant type of combinator, the features only need to be checked
462 // against descendants in the same subtree only. features.adjacent is set to fal se, and 466 // against descendants in the same subtree only. features.adjacent is set to fal se, and
463 // we start adding features to the descendant invalidation set. 467 // we start adding features to the descendant invalidation set.
464 468
465 void RuleFeatureSet::addFeaturesToInvalidationSet(InvalidationSet& invalidationS et, const InvalidationSetFeatures& features) 469 void RuleFeatureSet::addFeaturesToInvalidationSet(InvalidationSet& invalidationS et, const InvalidationSetFeatures& features)
466 { 470 {
467 if (features.treeBoundaryCrossing) 471 if (features.treeBoundaryCrossing)
468 invalidationSet.setTreeBoundaryCrossing(); 472 invalidationSet.setTreeBoundaryCrossing();
469 if (features.insertionPointCrossing) 473 if (features.insertionPointCrossing)
470 invalidationSet.setInsertionPointCrossing(); 474 invalidationSet.setInsertionPointCrossing();
475 if (features.invalidatesSlotted)
476 invalidationSet.setInvalidatesSlotted();
471 if (features.forceSubtree) 477 if (features.forceSubtree)
472 invalidationSet.setWholeSubtreeInvalid(); 478 invalidationSet.setWholeSubtreeInvalid();
473 if (features.contentPseudoCrossing || features.forceSubtree) 479 if (features.contentPseudoCrossing || features.forceSubtree)
474 return; 480 return;
475 481
476 if (!features.id.isEmpty()) 482 if (!features.id.isEmpty())
477 invalidationSet.addId(features.id); 483 invalidationSet.addId(features.id);
478 if (!features.tagName.isEmpty()) 484 if (!features.tagName.isEmpty())
479 invalidationSet.addTagName(features.tagName); 485 invalidationSet.addTagName(features.tagName);
480 for (const auto& className : features.classes) 486 for (const auto& className : features.classes)
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 778
773 DEFINE_TRACE(RuleFeatureSet) 779 DEFINE_TRACE(RuleFeatureSet)
774 { 780 {
775 #if ENABLE(OILPAN) 781 #if ENABLE(OILPAN)
776 visitor->trace(siblingRules); 782 visitor->trace(siblingRules);
777 visitor->trace(uncommonAttributeRules); 783 visitor->trace(uncommonAttributeRules);
778 #endif 784 #endif
779 } 785 }
780 786
781 } // namespace blink 787 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.h ('k') | third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698