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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 if (current->pseudoType() == CSSSelector::PseudoWindowInactive) | 580 if (current->pseudoType() == CSSSelector::PseudoWindowInactive) |
581 metadata.usesWindowInactiveSelector = true; | 581 metadata.usesWindowInactiveSelector = true; |
582 if (current->relation() == CSSSelector::DirectAdjacent) { | 582 if (current->relation() == CSSSelector::DirectAdjacent) { |
583 maxDirectAdjacentSelectors++; | 583 maxDirectAdjacentSelectors++; |
584 } else if (maxDirectAdjacentSelectors | 584 } else if (maxDirectAdjacentSelectors |
585 && ((current->relation() != CSSSelector::SubSelector) || current->is
LastInTagHistory())) { | 585 && ((current->relation() != CSSSelector::SubSelector) || current->is
LastInTagHistory())) { |
586 if (maxDirectAdjacentSelectors > metadata.maxDirectAdjacentSelectors
) | 586 if (maxDirectAdjacentSelectors > metadata.maxDirectAdjacentSelectors
) |
587 metadata.maxDirectAdjacentSelectors = maxDirectAdjacentSelectors
; | 587 metadata.maxDirectAdjacentSelectors = maxDirectAdjacentSelectors
; |
588 maxDirectAdjacentSelectors = 0; | 588 maxDirectAdjacentSelectors = 0; |
589 } | 589 } |
590 if (!metadata.foundInsertionPointCrossing && current->isSiblingSelector(
)) | 590 if (!metadata.foundInsertionPointCrossing && current->isSiblingPseudo()) |
591 metadata.foundSiblingSelector = true; | 591 metadata.foundSiblingSelector = true; |
592 | 592 |
593 if (const CSSSelectorList* selectorList = current->selectorList()) { | 593 if (const CSSSelectorList* selectorList = current->selectorList()) { |
594 for (const CSSSelector* subSelector = selectorList->first(); subSele
ctor; subSelector = CSSSelectorList::next(*subSelector)) | 594 for (const CSSSelector* subSelector = selectorList->first(); subSele
ctor; subSelector = CSSSelectorList::next(*subSelector)) |
595 collectFeaturesFromSelector(*subSelector, metadata); | 595 collectFeaturesFromSelector(*subSelector, metadata); |
596 } | 596 } |
597 if (current->relationIsAffectedByPseudoContent()) | 597 if (current->relationIsAffectedByPseudoContent() |
| 598 || current->pseudoType() == CSSSelector::PseudoHost |
| 599 || current->pseudoType() == CSSSelector::PseudoHostContext |
| 600 || current->pseudoType() == CSSSelector::PseudoSlotted) { |
598 metadata.foundInsertionPointCrossing = true; | 601 metadata.foundInsertionPointCrossing = true; |
| 602 } |
| 603 if (!metadata.foundInsertionPointCrossing && current->isAdjacentSelector
()) |
| 604 metadata.foundSiblingSelector = true; |
599 } | 605 } |
600 | 606 |
601 ASSERT(!maxDirectAdjacentSelectors); | 607 ASSERT(!maxDirectAdjacentSelectors); |
602 } | 608 } |
603 | 609 |
604 void RuleFeatureSet::FeatureMetadata::add(const FeatureMetadata& other) | 610 void RuleFeatureSet::FeatureMetadata::add(const FeatureMetadata& other) |
605 { | 611 { |
606 usesFirstLineRules = usesFirstLineRules || other.usesFirstLineRules; | 612 usesFirstLineRules = usesFirstLineRules || other.usesFirstLineRules; |
607 usesWindowInactiveSelector = usesWindowInactiveSelector || other.usesWindowI
nactiveSelector; | 613 usesWindowInactiveSelector = usesWindowInactiveSelector || other.usesWindowI
nactiveSelector; |
608 maxDirectAdjacentSelectors = std::max(maxDirectAdjacentSelectors, other.maxD
irectAdjacentSelectors); | 614 maxDirectAdjacentSelectors = std::max(maxDirectAdjacentSelectors, other.maxD
irectAdjacentSelectors); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 | 737 |
732 DEFINE_TRACE(RuleFeatureSet) | 738 DEFINE_TRACE(RuleFeatureSet) |
733 { | 739 { |
734 #if ENABLE(OILPAN) | 740 #if ENABLE(OILPAN) |
735 visitor->trace(siblingRules); | 741 visitor->trace(siblingRules); |
736 visitor->trace(uncommonAttributeRules); | 742 visitor->trace(uncommonAttributeRules); |
737 #endif | 743 #endif |
738 } | 744 } |
739 | 745 |
740 } // namespace blink | 746 } // namespace blink |
OLD | NEW |