| OLD | NEW |
| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 return true; | 296 return true; |
| 297 } | 297 } |
| 298 if (selector.isAttributeSelector()) { | 298 if (selector.isAttributeSelector()) { |
| 299 features.attributes.append(selector.attribute().localName()); | 299 features.attributes.append(selector.attribute().localName()); |
| 300 return true; | 300 return true; |
| 301 } | 301 } |
| 302 if (selector.getPseudoType() == CSSSelector::PseudoWebKitCustomElement || se
lector.getPseudoType() == CSSSelector::PseudoBlinkInternalElement) { | 302 if (selector.getPseudoType() == CSSSelector::PseudoWebKitCustomElement || se
lector.getPseudoType() == CSSSelector::PseudoBlinkInternalElement) { |
| 303 features.customPseudoElement = true; | 303 features.customPseudoElement = true; |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 // Returning false for ::before and ::after as they are not used as | |
| 307 // invalidation set features, only used later to generate invalidation sets | |
| 308 // for attributes present in "content: attr(...)" declarations. | |
| 309 if (selector.getPseudoType() == CSSSelector::PseudoBefore || selector.getPse
udoType() == CSSSelector::PseudoAfter) | 306 if (selector.getPseudoType() == CSSSelector::PseudoBefore || selector.getPse
udoType() == CSSSelector::PseudoAfter) |
| 310 features.hasBeforeOrAfter = true; | 307 features.hasBeforeOrAfter = true; |
| 311 return false; | 308 return false; |
| 312 } | 309 } |
| 313 | 310 |
| 314 InvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSSelector& s
elector, InvalidationType type) | 311 InvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSSelector& s
elector, InvalidationType type) |
| 315 { | 312 { |
| 316 if (selector.match() == CSSSelector::Class) | 313 if (selector.match() == CSSSelector::Class) |
| 317 return &ensureClassInvalidationSet(selector.value(), type); | 314 return &ensureClassInvalidationSet(selector.value(), type); |
| 318 if (selector.isAttributeSelector()) | 315 if (selector.isAttributeSelector()) |
| 319 return &ensureAttributeInvalidationSet(selector.attribute().localName(),
type); | 316 return &ensureAttributeInvalidationSet(selector.attribute().localName(),
type); |
| 320 if (selector.match() == CSSSelector::Id) | 317 if (selector.match() == CSSSelector::Id) |
| 321 return &ensureIdInvalidationSet(selector.value(), type); | 318 return &ensureIdInvalidationSet(selector.value(), type); |
| 322 if (selector.match() == CSSSelector::PseudoClass) { | 319 if (selector.match() == CSSSelector::PseudoClass) { |
| 323 switch (selector.getPseudoType()) { | 320 switch (selector.getPseudoType()) { |
| 324 case CSSSelector::PseudoEmpty: | 321 case CSSSelector::PseudoEmpty: |
| 325 case CSSSelector::PseudoFirstChild: | |
| 326 case CSSSelector::PseudoLastChild: | |
| 327 case CSSSelector::PseudoOnlyChild: | |
| 328 case CSSSelector::PseudoLink: | 322 case CSSSelector::PseudoLink: |
| 329 case CSSSelector::PseudoVisited: | 323 case CSSSelector::PseudoVisited: |
| 330 case CSSSelector::PseudoAnyLink: | 324 case CSSSelector::PseudoAnyLink: |
| 331 case CSSSelector::PseudoAutofill: | 325 case CSSSelector::PseudoAutofill: |
| 332 case CSSSelector::PseudoHover: | 326 case CSSSelector::PseudoHover: |
| 333 case CSSSelector::PseudoDrag: | 327 case CSSSelector::PseudoDrag: |
| 334 case CSSSelector::PseudoFocus: | 328 case CSSSelector::PseudoFocus: |
| 335 case CSSSelector::PseudoActive: | 329 case CSSSelector::PseudoActive: |
| 336 case CSSSelector::PseudoChecked: | 330 case CSSSelector::PseudoChecked: |
| 337 case CSSSelector::PseudoEnabled: | 331 case CSSSelector::PseudoEnabled: |
| 338 case CSSSelector::PseudoDefault: | 332 case CSSSelector::PseudoDefault: |
| 339 case CSSSelector::PseudoDisabled: | 333 case CSSSelector::PseudoDisabled: |
| 340 case CSSSelector::PseudoOptional: | 334 case CSSSelector::PseudoOptional: |
| 341 case CSSSelector::PseudoPlaceholderShown: | 335 case CSSSelector::PseudoPlaceholderShown: |
| 342 case CSSSelector::PseudoRequired: | 336 case CSSSelector::PseudoRequired: |
| 343 case CSSSelector::PseudoReadOnly: | 337 case CSSSelector::PseudoReadOnly: |
| 344 case CSSSelector::PseudoReadWrite: | 338 case CSSSelector::PseudoReadWrite: |
| 345 case CSSSelector::PseudoValid: | 339 case CSSSelector::PseudoValid: |
| 346 case CSSSelector::PseudoInvalid: | 340 case CSSSelector::PseudoInvalid: |
| 347 case CSSSelector::PseudoIndeterminate: | 341 case CSSSelector::PseudoIndeterminate: |
| 348 case CSSSelector::PseudoTarget: | 342 case CSSSelector::PseudoTarget: |
| 349 case CSSSelector::PseudoLang: | 343 case CSSSelector::PseudoLang: |
| 350 case CSSSelector::PseudoFullScreen: | 344 case CSSSelector::PseudoFullScreen: |
| 351 case CSSSelector::PseudoFullScreenAncestor: | 345 case CSSSelector::PseudoFullScreenAncestor: |
| 352 case CSSSelector::PseudoInRange: | 346 case CSSSelector::PseudoInRange: |
| 353 case CSSSelector::PseudoOutOfRange: | 347 case CSSSelector::PseudoOutOfRange: |
| 354 case CSSSelector::PseudoUnresolved: | 348 case CSSSelector::PseudoUnresolved: |
| 355 case CSSSelector::PseudoDefined: | 349 case CSSSelector::PseudoDefined: |
| 356 return &ensurePseudoInvalidationSet(selector.getPseudoType(), type); | 350 return &ensurePseudoInvalidationSet(selector.getPseudoType(), type); |
| 357 case CSSSelector::PseudoFirstOfType: | |
| 358 case CSSSelector::PseudoLastOfType: | |
| 359 case CSSSelector::PseudoOnlyOfType: | |
| 360 case CSSSelector::PseudoNthChild: | |
| 361 case CSSSelector::PseudoNthOfType: | |
| 362 case CSSSelector::PseudoNthLastChild: | |
| 363 case CSSSelector::PseudoNthLastOfType: | |
| 364 return &ensureNthInvalidationSet(); | |
| 365 default: | 351 default: |
| 366 break; | 352 break; |
| 367 } | 353 } |
| 368 } | 354 } |
| 369 return nullptr; | 355 return nullptr; |
| 370 } | 356 } |
| 371 | 357 |
| 372 // Given a rule, update the descendant invalidation sets for the features found | 358 // Given a rule, update the descendant invalidation sets for the features found |
| 373 // in its selector. The first step is to extract the features from the rightmost | 359 // in its selector. The first step is to extract the features from the rightmost |
| 374 // compound selector (extractInvalidationSetFeatures). Secondly, add those featu
res | 360 // compound selector (extractInvalidationSetFeatures). Secondly, add those featu
res |
| 375 // to the invalidation sets for the features found in the other compound selecto
rs | 361 // to the invalidation sets for the features found in the other compound selecto
rs |
| 376 // (addFeaturesToInvalidationSets). If we find a feature in the right-most compo
und | 362 // (addFeaturesToInvalidationSets). If we find a feature in the right-most compo
und |
| 377 // selector that requires a subtree recalc, we addFeaturesToInvalidationSets for
the | 363 // selector that requires a subtree recalc, we addFeaturesToInvalidationSets for
the |
| 378 // rightmost compound selector as well. | 364 // rightmost compound selector as well. |
| 379 | 365 |
| 380 void RuleFeatureSet::updateInvalidationSets(const RuleData& ruleData) | 366 void RuleFeatureSet::updateInvalidationSets(const RuleData& ruleData) |
| 381 { | 367 { |
| 382 InvalidationSetFeatures features; | 368 InvalidationSetFeatures features; |
| 383 auto result = extractInvalidationSetFeatures(ruleData.selector(), features,
Subject); | 369 auto result = extractInvalidationSetFeatures(ruleData.selector(), features,
Subject); |
| 384 | 370 |
| 385 features.forceSubtree = result.second == ForceSubtree; | |
| 386 if (result.first) { | 371 if (result.first) { |
| 372 features.forceSubtree = result.second == ForceSubtree; |
| 387 addFeaturesToInvalidationSets(result.first, features.adjacent ? &feature
s : nullptr, features); | 373 addFeaturesToInvalidationSets(result.first, features.adjacent ? &feature
s : nullptr, features); |
| 388 } else if (features.hasNthPseudo) { | |
| 389 DCHECK(m_nthInvalidationSet); | |
| 390 addFeaturesToInvalidationSet(*m_nthInvalidationSet, features); | |
| 391 } | 374 } |
| 392 | 375 |
| 393 // If any ::before and ::after rules specify 'content: attr(...)', we | 376 // If any ::before and ::after rules specify 'content: attr(...)', we |
| 394 // need to create invalidation sets for those attributes. | 377 // need to create invalidation sets for those attributes. |
| 395 if (features.hasBeforeOrAfter) | 378 if (features.hasBeforeOrAfter) |
| 396 updateInvalidationSetsForContentAttribute(ruleData); | 379 updateInvalidationSetsForContentAttribute(ruleData); |
| 397 } | 380 } |
| 398 | 381 |
| 399 void RuleFeatureSet::updateInvalidationSetsForContentAttribute(const RuleData& r
uleData) | 382 void RuleFeatureSet::updateInvalidationSetsForContentAttribute(const RuleData& r
uleData) |
| 400 { | 383 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 423 | 406 |
| 424 std::pair<const CSSSelector*, RuleFeatureSet::UseFeaturesType> | 407 std::pair<const CSSSelector*, RuleFeatureSet::UseFeaturesType> |
| 425 RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelector& selector, Inva
lidationSetFeatures& features, PositionType position, CSSSelector::PseudoType ps
eudo) | 408 RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelector& selector, Inva
lidationSetFeatures& features, PositionType position, CSSSelector::PseudoType ps
eudo) |
| 426 { | 409 { |
| 427 bool foundFeatures = false; | 410 bool foundFeatures = false; |
| 428 for (const CSSSelector* current = &selector; current; current = current->tag
History()) { | 411 for (const CSSSelector* current = &selector; current; current = current->tag
History()) { |
| 429 if (pseudo != CSSSelector::PseudoNot) | 412 if (pseudo != CSSSelector::PseudoNot) |
| 430 foundFeatures |= extractInvalidationSetFeature(*current, features); | 413 foundFeatures |= extractInvalidationSetFeature(*current, features); |
| 431 // Initialize the entry in the invalidation set map, if supported. | 414 // Initialize the entry in the invalidation set map, if supported. |
| 432 if (InvalidationSet* invalidationSet = invalidationSetForSelector(*curre
nt, InvalidateDescendants)) { | 415 if (InvalidationSet* invalidationSet = invalidationSetForSelector(*curre
nt, InvalidateDescendants)) { |
| 433 if (position == Subject) { | 416 if (position == Subject) |
| 434 if (invalidationSet == m_nthInvalidationSet) | 417 invalidationSet->setInvalidatesSelf(); |
| 435 features.hasNthPseudo = true; | |
| 436 else | |
| 437 invalidationSet->setInvalidatesSelf(); | |
| 438 } | |
| 439 } else { | 418 } else { |
| 440 if (requiresSubtreeInvalidation(*current)) { | 419 if (requiresSubtreeInvalidation(*current)) { |
| 441 // Fall back to use subtree invalidations, even for features in
the | 420 // Fall back to use subtree invalidations, even for features in
the |
| 442 // rightmost compound selector. Returning the start &selector he
re | 421 // rightmost compound selector. Returning the start &selector he
re |
| 443 // will make addFeaturesToInvalidationSets start marking invalid
ation | 422 // will make addFeaturesToInvalidationSets start marking invalid
ation |
| 444 // sets for subtree recalc for features in the rightmost compoun
d | 423 // sets for subtree recalc for features in the rightmost compoun
d |
| 445 // selector. | 424 // selector. |
| 446 return std::make_pair(&selector, ForceSubtree); | 425 return std::make_pair(&selector, ForceSubtree); |
| 447 } | 426 } |
| 448 if (const CSSSelectorList* selectorList = current->selectorList()) { | 427 if (const CSSSelectorList* selectorList = current->selectorList()) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 463 } | 442 } |
| 464 allSubSelectorsHaveFeatures &= result.second == UseFeatures; | 443 allSubSelectorsHaveFeatures &= result.second == UseFeatures; |
| 465 } | 444 } |
| 466 foundFeatures |= allSubSelectorsHaveFeatures; | 445 foundFeatures |= allSubSelectorsHaveFeatures; |
| 467 } | 446 } |
| 468 } | 447 } |
| 469 | 448 |
| 470 if (current->relation() == CSSSelector::SubSelector) | 449 if (current->relation() == CSSSelector::SubSelector) |
| 471 continue; | 450 continue; |
| 472 | 451 |
| 473 if (features.hasNthPseudo && position == Subject) { | |
| 474 DCHECK(m_nthInvalidationSet); | |
| 475 if (foundFeatures) | |
| 476 addFeaturesToInvalidationSet(*m_nthInvalidationSet, features); | |
| 477 else | |
| 478 m_nthInvalidationSet->setWholeSubtreeInvalid(); | |
| 479 } | |
| 480 | |
| 481 features.treeBoundaryCrossing = current->isShadowSelector(); | 452 features.treeBoundaryCrossing = current->isShadowSelector(); |
| 482 if (current->relationIsAffectedByPseudoContent()) { | 453 if (current->relationIsAffectedByPseudoContent()) { |
| 483 features.contentPseudoCrossing = true; | 454 features.contentPseudoCrossing = true; |
| 484 features.insertionPointCrossing = true; | 455 features.insertionPointCrossing = true; |
| 485 } | 456 } |
| 486 features.adjacent = current->isAdjacentSelector(); | 457 features.adjacent = current->isAdjacentSelector(); |
| 487 if (current->relation() == CSSSelector::DirectAdjacent) | 458 if (current->relation() == CSSSelector::DirectAdjacent) |
| 488 features.maxDirectAdjacentSelectors = 1; | 459 features.maxDirectAdjacentSelectors = 1; |
| 489 return std::make_pair(current->tagHistory(), foundFeatures ? UseFeatures
: ForceSubtree); | 460 return std::make_pair(current->tagHistory(), foundFeatures ? UseFeatures
: ForceSubtree); |
| 490 } | 461 } |
| 491 return std::make_pair(nullptr, foundFeatures ? UseFeatures : ForceSubtree); | 462 return std::make_pair(nullptr, foundFeatures ? UseFeatures : ForceSubtree); |
| 492 } | 463 } |
| 493 | 464 |
| 494 // Add features extracted from the rightmost compound selector to descendant inv
alidation | 465 // Add features extracted from the rightmost compound selector to descendant inv
alidation |
| 495 // sets for features found in other compound selectors. | 466 // sets for features found in other compound selectors. |
| 496 // | 467 // |
| 497 // We use descendant invalidation for descendants, sibling invalidation for sibl
ings and their subtrees. | 468 // We use descendant invalidation for descendants, sibling invalidation for sibl
ings and their subtrees. |
| 498 // | 469 // |
| 499 // As we encounter a descendant type of combinator, the features only need to be
checked | 470 // As we encounter a descendant type of combinator, the features only need to be
checked |
| 500 // against descendants in the same subtree only. features.adjacent is set to fal
se, and | 471 // against descendants in the same subtree only. features.adjacent is set to fal
se, and |
| 501 // we start adding features to the descendant invalidation set. | 472 // we start adding features to the descendant invalidation set. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // We set siblingFeatures to &localFeatures if we find a rightmost sibling c
ombinator. | 506 // We set siblingFeatures to &localFeatures if we find a rightmost sibling c
ombinator. |
| 536 InvalidationSetFeatures localFeatures; | 507 InvalidationSetFeatures localFeatures; |
| 537 | 508 |
| 538 bool universalCompound = true; | 509 bool universalCompound = true; |
| 539 | 510 |
| 540 for (const CSSSelector* current = selector; current; current = current->tagH
istory()) { | 511 for (const CSSSelector* current = selector; current; current = current->tagH
istory()) { |
| 541 InvalidationType type = siblingFeatures ? InvalidateSiblings : Invalidat
eDescendants; | 512 InvalidationType type = siblingFeatures ? InvalidateSiblings : Invalidat
eDescendants; |
| 542 if (InvalidationSet* invalidationSet = invalidationSetForSelector(*curre
nt, type)) { | 513 if (InvalidationSet* invalidationSet = invalidationSetForSelector(*curre
nt, type)) { |
| 543 if (current->match() != CSSSelector::PseudoClass) | 514 if (current->match() != CSSSelector::PseudoClass) |
| 544 universalCompound = false; | 515 universalCompound = false; |
| 545 if (siblingFeatures && invalidationSet != m_nthInvalidationSet) { | 516 if (siblingFeatures) { |
| 546 SiblingInvalidationSet* siblingInvalidationSet = toSiblingInvali
dationSet(invalidationSet); | 517 SiblingInvalidationSet* siblingInvalidationSet = toSiblingInvali
dationSet(invalidationSet); |
| 547 siblingInvalidationSet->updateMaxDirectAdjacentSelectors(sibling
Features->maxDirectAdjacentSelectors); | 518 siblingInvalidationSet->updateMaxDirectAdjacentSelectors(sibling
Features->maxDirectAdjacentSelectors); |
| 548 | 519 |
| 549 addFeaturesToInvalidationSet(*invalidationSet, *siblingFeatures)
; | 520 addFeaturesToInvalidationSet(*invalidationSet, *siblingFeatures)
; |
| 550 if (siblingFeatures == &descendantFeatures) | 521 if (siblingFeatures == &descendantFeatures) |
| 551 siblingInvalidationSet->setInvalidatesSelf(); | 522 siblingInvalidationSet->setInvalidatesSelf(); |
| 552 else | 523 else |
| 553 addFeaturesToInvalidationSet(siblingInvalidationSet->ensureS
iblingDescendants(), descendantFeatures); | 524 addFeaturesToInvalidationSet(siblingInvalidationSet->ensureS
iblingDescendants(), descendantFeatures); |
| 554 } else { | 525 } else { |
| 555 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature
s); | 526 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature
s); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 for (const auto& entry : other.m_classInvalidationSets) | 688 for (const auto& entry : other.m_classInvalidationSets) |
| 718 ensureInvalidationSet(m_classInvalidationSets, entry.key, entry.value->t
ype()).combine(*entry.value); | 689 ensureInvalidationSet(m_classInvalidationSets, entry.key, entry.value->t
ype()).combine(*entry.value); |
| 719 for (const auto& entry : other.m_attributeInvalidationSets) | 690 for (const auto& entry : other.m_attributeInvalidationSets) |
| 720 ensureInvalidationSet(m_attributeInvalidationSets, entry.key, entry.valu
e->type()).combine(*entry.value); | 691 ensureInvalidationSet(m_attributeInvalidationSets, entry.key, entry.valu
e->type()).combine(*entry.value); |
| 721 for (const auto& entry : other.m_idInvalidationSets) | 692 for (const auto& entry : other.m_idInvalidationSets) |
| 722 ensureInvalidationSet(m_idInvalidationSets, entry.key, entry.value->type
()).combine(*entry.value); | 693 ensureInvalidationSet(m_idInvalidationSets, entry.key, entry.value->type
()).combine(*entry.value); |
| 723 for (const auto& entry : other.m_pseudoInvalidationSets) | 694 for (const auto& entry : other.m_pseudoInvalidationSets) |
| 724 ensureInvalidationSet(m_pseudoInvalidationSets, static_cast<CSSSelector:
:PseudoType>(entry.key), entry.value->type()).combine(*entry.value); | 695 ensureInvalidationSet(m_pseudoInvalidationSets, static_cast<CSSSelector:
:PseudoType>(entry.key), entry.value->type()).combine(*entry.value); |
| 725 if (other.m_universalSiblingInvalidationSet) | 696 if (other.m_universalSiblingInvalidationSet) |
| 726 ensureUniversalSiblingInvalidationSet().combine(*other.m_universalSiblin
gInvalidationSet); | 697 ensureUniversalSiblingInvalidationSet().combine(*other.m_universalSiblin
gInvalidationSet); |
| 727 if (other.m_nthInvalidationSet) | |
| 728 ensureNthInvalidationSet().combine(*other.m_nthInvalidationSet); | |
| 729 | 698 |
| 730 m_metadata.add(other.m_metadata); | 699 m_metadata.add(other.m_metadata); |
| 731 | 700 |
| 732 siblingRules.appendVector(other.siblingRules); | 701 siblingRules.appendVector(other.siblingRules); |
| 733 uncommonAttributeRules.appendVector(other.uncommonAttributeRules); | 702 uncommonAttributeRules.appendVector(other.uncommonAttributeRules); |
| 734 } | 703 } |
| 735 | 704 |
| 736 void RuleFeatureSet::clear() | 705 void RuleFeatureSet::clear() |
| 737 { | 706 { |
| 738 siblingRules.clear(); | 707 siblingRules.clear(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 invalidationLists.siblings.append(m_universalSiblingInvalidationSet); | 857 invalidationLists.siblings.append(m_universalSiblingInvalidationSet); |
| 889 } | 858 } |
| 890 | 859 |
| 891 SiblingInvalidationSet& RuleFeatureSet::ensureUniversalSiblingInvalidationSet() | 860 SiblingInvalidationSet& RuleFeatureSet::ensureUniversalSiblingInvalidationSet() |
| 892 { | 861 { |
| 893 if (!m_universalSiblingInvalidationSet) | 862 if (!m_universalSiblingInvalidationSet) |
| 894 m_universalSiblingInvalidationSet = SiblingInvalidationSet::create(nullp
tr); | 863 m_universalSiblingInvalidationSet = SiblingInvalidationSet::create(nullp
tr); |
| 895 return *m_universalSiblingInvalidationSet; | 864 return *m_universalSiblingInvalidationSet; |
| 896 } | 865 } |
| 897 | 866 |
| 898 void RuleFeatureSet::collectNthInvalidationSet(InvalidationLists& invalidationLi
sts) const | |
| 899 { | |
| 900 if (m_nthInvalidationSet) | |
| 901 invalidationLists.descendants.append(m_nthInvalidationSet); | |
| 902 } | |
| 903 | |
| 904 DescendantInvalidationSet& RuleFeatureSet::ensureNthInvalidationSet() | |
| 905 { | |
| 906 if (!m_nthInvalidationSet) | |
| 907 m_nthInvalidationSet = DescendantInvalidationSet::create(); | |
| 908 return *m_nthInvalidationSet; | |
| 909 } | |
| 910 | |
| 911 void RuleFeatureSet::addFeaturesToUniversalSiblingInvalidationSet(const Invalida
tionSetFeatures& siblingFeatures, const InvalidationSetFeatures& descendantFeatu
res) | 867 void RuleFeatureSet::addFeaturesToUniversalSiblingInvalidationSet(const Invalida
tionSetFeatures& siblingFeatures, const InvalidationSetFeatures& descendantFeatu
res) |
| 912 { | 868 { |
| 913 SiblingInvalidationSet& universalSet = ensureUniversalSiblingInvalidationSet
(); | 869 SiblingInvalidationSet& universalSet = ensureUniversalSiblingInvalidationSet
(); |
| 914 addFeaturesToInvalidationSet(universalSet, siblingFeatures); | 870 addFeaturesToInvalidationSet(universalSet, siblingFeatures); |
| 915 universalSet.updateMaxDirectAdjacentSelectors(siblingFeatures.maxDirectAdjac
entSelectors); | 871 universalSet.updateMaxDirectAdjacentSelectors(siblingFeatures.maxDirectAdjac
entSelectors); |
| 916 | 872 |
| 917 if (&siblingFeatures == &descendantFeatures) | 873 if (&siblingFeatures == &descendantFeatures) |
| 918 universalSet.setInvalidatesSelf(); | 874 universalSet.setInvalidatesSelf(); |
| 919 else | 875 else |
| 920 addFeaturesToInvalidationSet(universalSet.ensureSiblingDescendants(), de
scendantFeatures); | 876 addFeaturesToInvalidationSet(universalSet.ensureSiblingDescendants(), de
scendantFeatures); |
| 921 } | 877 } |
| 922 | 878 |
| 923 DEFINE_TRACE(RuleFeatureSet) | 879 DEFINE_TRACE(RuleFeatureSet) |
| 924 { | 880 { |
| 925 visitor->trace(siblingRules); | 881 visitor->trace(siblingRules); |
| 926 visitor->trace(uncommonAttributeRules); | 882 visitor->trace(uncommonAttributeRules); |
| 927 } | 883 } |
| 928 | 884 |
| 929 } // namespace blink | 885 } // namespace blink |
| OLD | NEW |