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

Side by Side Diff: Source/core/css/TreeBoundaryCrossingRules.cpp

Issue 313303002: Change shadow style's scope from Shadow Host to Shadow Root (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix merge failure Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 CascadeOrder outerCascadeOrder = size() + size(); 72 CascadeOrder outerCascadeOrder = size() + size();
73 // When comparing rules declared in inner treescopes, inner's rules win. 73 // When comparing rules declared in inner treescopes, inner's rules win.
74 CascadeOrder innerCascadeOrder = size(); 74 CascadeOrder innerCascadeOrder = size();
75 75
76 for (DocumentOrderedList::iterator it = m_scopingNodes.begin(); it != m_scop ingNodes.end(); ++it) { 76 for (DocumentOrderedList::iterator it = m_scopingNodes.begin(); it != m_scop ingNodes.end(); ++it) {
77 const ContainerNode* scopingNode = toContainerNode(*it); 77 const ContainerNode* scopingNode = toContainerNode(*it);
78 CSSStyleSheetRuleSubSet* ruleSubSet = m_treeBoundaryCrossingRuleSetMap.g et(scopingNode); 78 CSSStyleSheetRuleSubSet* ruleSubSet = m_treeBoundaryCrossingRuleSetMap.g et(scopingNode);
79 unsigned boundaryBehavior = SelectorChecker::ScopeContainsLastMatchedEle ment; 79 unsigned boundaryBehavior = SelectorChecker::ScopeContainsLastMatchedEle ment;
80 bool isInnerTreeScope = element->treeScope().isInclusiveAncestorOf(scopi ngNode->treeScope()); 80 bool isInnerTreeScope = element->treeScope().isInclusiveAncestorOf(scopi ngNode->treeScope());
81 81
82 // If a given scoping node is a shadow root, 82 // If a given scoping node is a shadow root, we should use ScopeIsShadow Root.
83 // we should use ScopeIsShadowHost. 83 if (scopingNode && scopingNode->isShadowRoot())
84 if (scopingNode && scopingNode->isShadowRoot()) { 84 boundaryBehavior |= SelectorChecker::ScopeIsShadowRoot;
85 boundaryBehavior |= SelectorChecker::ScopeIsShadowHost;
86 scopingNode = toShadowRoot(scopingNode)->host();
87 }
88 85
89 CascadeOrder cascadeOrder = isInnerTreeScope ? innerCascadeOrder : outer CascadeOrder; 86 CascadeOrder cascadeOrder = isInnerTreeScope ? innerCascadeOrder : outer CascadeOrder;
90 for (CSSStyleSheetRuleSubSet::iterator it = ruleSubSet->begin(); it != r uleSubSet->end(); ++it) { 87 for (CSSStyleSheetRuleSubSet::iterator it = ruleSubSet->begin(); it != r uleSubSet->end(); ++it) {
91 CSSStyleSheet* parentStyleSheet = it->first; 88 CSSStyleSheet* parentStyleSheet = it->first;
92 RuleSet* ruleSet = it->second.get(); 89 RuleSet* ruleSet = it->second.get();
93 collector.collectMatchingRules(MatchRequest(ruleSet, includeEmptyRul es, scopingNode, parentStyleSheet), ruleRange, static_cast<SelectorChecker::Beha viorAtBoundary>(boundaryBehavior), ignoreCascadeScope, cascadeOrder); 90 collector.collectMatchingRules(MatchRequest(ruleSet, includeEmptyRul es, scopingNode, parentStyleSheet), ruleRange, static_cast<SelectorChecker::Beha viorAtBoundary>(boundaryBehavior), ignoreCascadeScope, cascadeOrder);
94 } 91 }
95 ++innerCascadeOrder; 92 ++innerCascadeOrder;
96 --outerCascadeOrder; 93 --outerCascadeOrder;
97 } 94 }
(...skipping 11 matching lines...) Expand all
109 features.add(it->second->features()); 106 features.add(it->second->features());
110 } 107 }
111 108
112 void TreeBoundaryCrossingRules::collectFeaturesTo(RuleFeatureSet& features) 109 void TreeBoundaryCrossingRules::collectFeaturesTo(RuleFeatureSet& features)
113 { 110 {
114 for (TreeBoundaryCrossingRuleSetMap::iterator::Values it = m_treeBoundaryCro ssingRuleSetMap.values().begin(); it != m_treeBoundaryCrossingRuleSetMap.values( ).end(); ++it) 111 for (TreeBoundaryCrossingRuleSetMap::iterator::Values it = m_treeBoundaryCro ssingRuleSetMap.values().begin(); it != m_treeBoundaryCrossingRuleSetMap.values( ).end(); ++it)
115 collectFeaturesFromRuleSubSet(it->get(), features); 112 collectFeaturesFromRuleSubSet(it->get(), features);
116 } 113 }
117 114
118 } // namespace WebCore 115 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698