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

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

Issue 1544893003: Don't add rule features across ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused method Created 4 years, 11 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // As we encounter a descendant type of combinator, the features only need to be checked 421 // As we encounter a descendant type of combinator, the features only need to be checked
422 // against descendants in the same subtree only. features.adjacent is set to fal se, and 422 // against descendants in the same subtree only. features.adjacent is set to fal se, and
423 // we start adding features to the descendant invalidation set. 423 // we start adding features to the descendant invalidation set.
424 424
425 void RuleFeatureSet::addFeaturesToInvalidationSet(InvalidationSet& invalidationS et, const InvalidationSetFeatures& features) 425 void RuleFeatureSet::addFeaturesToInvalidationSet(InvalidationSet& invalidationS et, const InvalidationSetFeatures& features)
426 { 426 {
427 if (features.treeBoundaryCrossing) 427 if (features.treeBoundaryCrossing)
428 invalidationSet.setTreeBoundaryCrossing(); 428 invalidationSet.setTreeBoundaryCrossing();
429 if (features.insertionPointCrossing) 429 if (features.insertionPointCrossing)
430 invalidationSet.setInsertionPointCrossing(); 430 invalidationSet.setInsertionPointCrossing();
431 if (features.forceSubtree) { 431 if (features.forceSubtree)
432 invalidationSet.setWholeSubtreeInvalid(); 432 invalidationSet.setWholeSubtreeInvalid();
433 if (features.contentPseudoCrossing || features.forceSubtree)
433 return; 434 return;
434 } 435
435 if (!features.id.isEmpty()) 436 if (!features.id.isEmpty())
436 invalidationSet.addId(features.id); 437 invalidationSet.addId(features.id);
437 if (!features.tagName.isEmpty()) 438 if (!features.tagName.isEmpty())
438 invalidationSet.addTagName(features.tagName); 439 invalidationSet.addTagName(features.tagName);
439 for (const auto& className : features.classes) 440 for (const auto& className : features.classes)
440 invalidationSet.addClass(className); 441 invalidationSet.addClass(className);
441 for (const auto& attribute : features.attributes) 442 for (const auto& attribute : features.attributes)
442 invalidationSet.addAttribute(attribute); 443 invalidationSet.addAttribute(attribute);
443 if (features.customPseudoElement) 444 if (features.customPseudoElement)
444 invalidationSet.setCustomPseudoInvalid(); 445 invalidationSet.setCustomPseudoInvalid();
(...skipping 20 matching lines...) Expand all
465 if (siblingFeatures == &descendantFeatures) 466 if (siblingFeatures == &descendantFeatures)
466 siblingInvalidationSet->descendants().setInvalidatesSelf(); 467 siblingInvalidationSet->descendants().setInvalidatesSelf();
467 else 468 else
468 addFeaturesToInvalidationSet(siblingInvalidationSet->descend ants(), descendantFeatures); 469 addFeaturesToInvalidationSet(siblingInvalidationSet->descend ants(), descendantFeatures);
469 } else { 470 } else {
470 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature s); 471 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature s);
471 } 472 }
472 } else { 473 } else {
473 if (current->isHostPseudoClass()) 474 if (current->isHostPseudoClass())
474 descendantFeatures.treeBoundaryCrossing = true; 475 descendantFeatures.treeBoundaryCrossing = true;
475 if (current->isInsertionPointCrossing()) 476 if (current->isInsertionPointCrossing()) {
476 descendantFeatures.insertionPointCrossing = true; 477 descendantFeatures.insertionPointCrossing = true;
478 if (current->pseudoType() == CSSSelector::PseudoContent)
479 descendantFeatures.contentPseudoCrossing = true;
480 }
477 if (const CSSSelectorList* selectorList = current->selectorList()) { 481 if (const CSSSelectorList* selectorList = current->selectorList()) {
478 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType( ))); 482 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType( )));
479 for (const CSSSelector* subSelector = selectorList->first(); sub Selector; subSelector = CSSSelectorList::next(*subSelector)) 483 for (const CSSSelector* subSelector = selectorList->first(); sub Selector; subSelector = CSSSelectorList::next(*subSelector))
480 addFeaturesToInvalidationSets(subSelector, siblingFeatures, descendantFeatures); 484 addFeaturesToInvalidationSets(subSelector, siblingFeatures, descendantFeatures);
481 } 485 }
482 } 486 }
483 487
484 if (current->relation() == CSSSelector::SubSelector) 488 if (current->relation() == CSSSelector::SubSelector)
485 continue; 489 continue;
486 490
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 674
671 DEFINE_TRACE(RuleFeatureSet) 675 DEFINE_TRACE(RuleFeatureSet)
672 { 676 {
673 #if ENABLE(OILPAN) 677 #if ENABLE(OILPAN)
674 visitor->trace(siblingRules); 678 visitor->trace(siblingRules);
675 visitor->trace(uncommonAttributeRules); 679 visitor->trace(uncommonAttributeRules);
676 #endif 680 #endif
677 } 681 }
678 682
679 } // namespace blink 683 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.h ('k') | third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698