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

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

Issue 1872343002: Allow multiple host pseudos in same compound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ... and a test with :host() Created 4 years, 8 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 case CSSSelector::PseudoOnlyOfType: 603 case CSSSelector::PseudoOnlyOfType:
604 case CSSSelector::PseudoNthChild: 604 case CSSSelector::PseudoNthChild:
605 case CSSSelector::PseudoNthOfType: 605 case CSSSelector::PseudoNthOfType:
606 case CSSSelector::PseudoNthLastChild: 606 case CSSSelector::PseudoNthLastChild:
607 case CSSSelector::PseudoNthLastOfType: 607 case CSSSelector::PseudoNthLastOfType:
608 if (!metadata.foundInsertionPointCrossing) 608 if (!metadata.foundInsertionPointCrossing)
609 metadata.foundSiblingSelector = true; 609 metadata.foundSiblingSelector = true;
610 break; 610 break;
611 case CSSSelector::PseudoHost: 611 case CSSSelector::PseudoHost:
612 case CSSSelector::PseudoHostContext: 612 case CSSSelector::PseudoHostContext:
613 if (relation == CSSSelector::SubSelector) 613 if (!foundHostPseudo && relation == CSSSelector::SubSelector)
614 return SelectorNeverMatches; 614 return SelectorNeverMatches;
615 if (!current->isLastInTagHistory() && current->tagHistory()->match() != CSSSelector::PseudoElement) 615 if (!current->isLastInTagHistory()
616 && current->tagHistory()->match() != CSSSelector::PseudoElement
617 && !current->tagHistory()->isHostPseudoClass()) {
616 return SelectorNeverMatches; 618 return SelectorNeverMatches;
619 }
617 foundHostPseudo = true; 620 foundHostPseudo = true;
618 // fall through. 621 // fall through.
619 default: 622 default:
620 if (const CSSSelectorList* selectorList = current->selectorList()) { 623 if (const CSSSelectorList* selectorList = current->selectorList()) {
621 for (const CSSSelector* subSelector = selectorList->first(); sub Selector; subSelector = CSSSelectorList::next(*subSelector)) 624 for (const CSSSelector* subSelector = selectorList->first(); sub Selector; subSelector = CSSSelectorList::next(*subSelector))
622 collectFeaturesFromSelector(*subSelector, metadata); 625 collectFeaturesFromSelector(*subSelector, metadata);
623 } 626 }
624 break; 627 break;
625 } 628 }
626 629
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 } 780 }
778 } 781 }
779 782
780 DEFINE_TRACE(RuleFeatureSet) 783 DEFINE_TRACE(RuleFeatureSet)
781 { 784 {
782 visitor->trace(siblingRules); 785 visitor->trace(siblingRules);
783 visitor->trace(uncommonAttributeRules); 786 visitor->trace(uncommonAttributeRules);
784 } 787 }
785 788
786 } // namespace blink 789 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698