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

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

Issue 789403005: Keep a separate list of :host(-context) rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added tests Created 6 years 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
« no previous file with comments | « Source/core/css/ElementRuleCollector.h ('k') | Source/core/css/RuleSet.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, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 if (element.isLink()) 169 if (element.isLink())
170 collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules() , cascadeScope, cascadeOrder, matchRequest, ruleRange); 170 collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules() , cascadeScope, cascadeOrder, matchRequest, ruleRange);
171 if (SelectorChecker::matchesFocusPseudoClass(element)) 171 if (SelectorChecker::matchesFocusPseudoClass(element))
172 collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules( ), cascadeScope, cascadeOrder, matchRequest, ruleRange); 172 collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules( ), cascadeScope, cascadeOrder, matchRequest, ruleRange);
173 collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localName ()), cascadeScope, cascadeOrder, matchRequest, ruleRange); 173 collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localName ()), cascadeScope, cascadeOrder, matchRequest, ruleRange);
174 collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeS cope, cascadeOrder, matchRequest, ruleRange); 174 collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeS cope, cascadeOrder, matchRequest, ruleRange);
175 } 175 }
176 176
177 void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& ma tchRequest, RuleRange& ruleRange, CascadeScope cascadeScope, CascadeOrder cascad eOrder, bool matchingTreeBoundaryRules)
178 {
179 collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), cascade Scope, cascadeOrder, matchRequest, ruleRange);
180 }
181
177 CSSRuleList* ElementRuleCollector::nestedRuleList(CSSRule* rule) 182 CSSRuleList* ElementRuleCollector::nestedRuleList(CSSRule* rule)
178 { 183 {
179 switch (rule->type()) { 184 switch (rule->type()) {
180 case CSSRule::MEDIA_RULE: 185 case CSSRule::MEDIA_RULE:
181 return toCSSMediaRule(rule)->cssRules(); 186 return toCSSMediaRule(rule)->cssRules();
182 case CSSRule::KEYFRAMES_RULE: 187 case CSSRule::KEYFRAMES_RULE:
183 return toCSSKeyframesRule(rule)->cssRules(); 188 return toCSSKeyframesRule(rule)->cssRules();
184 case CSSRule::SUPPORTS_RULE: 189 case CSSRule::SUPPORTS_RULE:
185 return toCSSSupportsRule(rule)->cssRules(); 190 return toCSSSupportsRule(rule)->cssRules();
186 default: 191 default:
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // information about "scope". 349 // information about "scope".
345 int firstRuleIndex = -1, lastRuleIndex = -1; 350 int firstRuleIndex = -1, lastRuleIndex = -1;
346 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); 351 RuleRange ruleRange(firstRuleIndex, lastRuleIndex);
347 // FIXME: Verify whether it's ok to ignore CascadeScope here. 352 // FIXME: Verify whether it's ok to ignore CascadeScope here.
348 collectMatchingRules(MatchRequest(ruleSet), ruleRange); 353 collectMatchingRules(MatchRequest(ruleSet), ruleRange);
349 354
350 return m_matchedRules && !m_matchedRules->isEmpty(); 355 return m_matchedRules && !m_matchedRules->isEmpty();
351 } 356 }
352 357
353 } // namespace blink 358 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/ElementRuleCollector.h ('k') | Source/core/css/RuleSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698