| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 allSubSelectorsHaveFeatures &= result.second == UseFeatures; | 398 allSubSelectorsHaveFeatures &= result.second == UseFeatures; |
| 399 } | 399 } |
| 400 foundFeatures |= allSubSelectorsHaveFeatures; | 400 foundFeatures |= allSubSelectorsHaveFeatures; |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 if (current->relation() == CSSSelector::SubSelector) | 404 if (current->relation() == CSSSelector::SubSelector) |
| 405 continue; | 405 continue; |
| 406 | 406 |
| 407 features.treeBoundaryCrossing = current->isShadowSelector(); | 407 features.treeBoundaryCrossing = current->isShadowSelector(); |
| 408 if (current->relationIsAffectedByPseudoContent()) { |
| 409 features.contentPseudoCrossing = true; |
| 410 features.insertionPointCrossing = true; |
| 411 } |
| 408 features.adjacent = current->isAdjacentSelector(); | 412 features.adjacent = current->isAdjacentSelector(); |
| 409 if (current->relation() == CSSSelector::DirectAdjacent) | 413 if (current->relation() == CSSSelector::DirectAdjacent) |
| 410 features.maxDirectAdjacentSelectors = 1; | 414 features.maxDirectAdjacentSelectors = 1; |
| 411 return std::make_pair(current->tagHistory(), foundFeatures ? UseFeatures
: ForceSubtree); | 415 return std::make_pair(current->tagHistory(), foundFeatures ? UseFeatures
: ForceSubtree); |
| 412 } | 416 } |
| 413 return std::make_pair(nullptr, foundFeatures ? UseFeatures : ForceSubtree); | 417 return std::make_pair(nullptr, foundFeatures ? UseFeatures : ForceSubtree); |
| 414 } | 418 } |
| 415 | 419 |
| 416 // Add features extracted from the rightmost compound selector to descendant inv
alidation | 420 // Add features extracted from the rightmost compound selector to descendant inv
alidation |
| 417 // sets for features found in other compound selectors. | 421 // sets for features found in other compound selectors. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 if (siblingFeatures == &descendantFeatures) | 470 if (siblingFeatures == &descendantFeatures) |
| 467 siblingInvalidationSet->descendants().setInvalidatesSelf(); | 471 siblingInvalidationSet->descendants().setInvalidatesSelf(); |
| 468 else | 472 else |
| 469 addFeaturesToInvalidationSet(siblingInvalidationSet->descend
ants(), descendantFeatures); | 473 addFeaturesToInvalidationSet(siblingInvalidationSet->descend
ants(), descendantFeatures); |
| 470 } else { | 474 } else { |
| 471 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature
s); | 475 addFeaturesToInvalidationSet(*invalidationSet, descendantFeature
s); |
| 472 } | 476 } |
| 473 } else { | 477 } else { |
| 474 if (current->isHostPseudoClass()) | 478 if (current->isHostPseudoClass()) |
| 475 descendantFeatures.treeBoundaryCrossing = true; | 479 descendantFeatures.treeBoundaryCrossing = true; |
| 476 if (current->isInsertionPointCrossing()) { | 480 if (current->isInsertionPointCrossing()) |
| 477 descendantFeatures.insertionPointCrossing = true; | 481 descendantFeatures.insertionPointCrossing = true; |
| 478 if (current->pseudoType() == CSSSelector::PseudoContent) | |
| 479 descendantFeatures.contentPseudoCrossing = true; | |
| 480 } | |
| 481 if (const CSSSelectorList* selectorList = current->selectorList()) { | 482 if (const CSSSelectorList* selectorList = current->selectorList()) { |
| 482 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType(
))); | 483 ASSERT(supportsInvalidationWithSelectorList(current->pseudoType(
))); |
| 483 for (const CSSSelector* subSelector = selectorList->first(); sub
Selector; subSelector = CSSSelectorList::next(*subSelector)) | 484 for (const CSSSelector* subSelector = selectorList->first(); sub
Selector; subSelector = CSSSelectorList::next(*subSelector)) |
| 484 addFeaturesToInvalidationSets(subSelector, siblingFeatures,
descendantFeatures); | 485 addFeaturesToInvalidationSets(subSelector, siblingFeatures,
descendantFeatures); |
| 485 } | 486 } |
| 486 } | 487 } |
| 487 | 488 |
| 488 if (current->relation() == CSSSelector::SubSelector) | 489 if (current->relation() == CSSSelector::SubSelector) |
| 489 continue; | 490 continue; |
| 490 | 491 |
| 492 if (current->relationIsAffectedByPseudoContent()) { |
| 493 descendantFeatures.insertionPointCrossing = true; |
| 494 descendantFeatures.contentPseudoCrossing = true; |
| 495 } |
| 491 if (current->isShadowSelector()) | 496 if (current->isShadowSelector()) |
| 492 descendantFeatures.treeBoundaryCrossing = true; | 497 descendantFeatures.treeBoundaryCrossing = true; |
| 493 | |
| 494 if (!current->isAdjacentSelector()) { | 498 if (!current->isAdjacentSelector()) { |
| 495 lastCompoundSelectorInAdjacentChain = current->tagHistory(); | 499 lastCompoundSelectorInAdjacentChain = current->tagHistory(); |
| 496 siblingFeatures = nullptr; | 500 siblingFeatures = nullptr; |
| 497 continue; | 501 continue; |
| 498 } | 502 } |
| 499 | 503 |
| 500 if (siblingFeatures) { | 504 if (siblingFeatures) { |
| 501 if (siblingFeatures->maxDirectAdjacentSelectors == UINT_MAX) | 505 if (siblingFeatures->maxDirectAdjacentSelectors == UINT_MAX) |
| 502 continue; | 506 continue; |
| 503 | 507 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 | 678 |
| 675 DEFINE_TRACE(RuleFeatureSet) | 679 DEFINE_TRACE(RuleFeatureSet) |
| 676 { | 680 { |
| 677 #if ENABLE(OILPAN) | 681 #if ENABLE(OILPAN) |
| 678 visitor->trace(siblingRules); | 682 visitor->trace(siblingRules); |
| 679 visitor->trace(uncommonAttributeRules); | 683 visitor->trace(uncommonAttributeRules); |
| 680 #endif | 684 #endif |
| 681 } | 685 } |
| 682 | 686 |
| 683 } // namespace blink | 687 } // namespace blink |
| OLD | NEW |