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

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

Issue 1129673002: Remove support for pseudo classes in <content select>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix more tests. Created 5 years, 7 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
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 19 matching lines...) Expand all
30 #include "core/css/ElementRuleCollector.h" 30 #include "core/css/ElementRuleCollector.h"
31 31
32 #include "core/css/CSSImportRule.h" 32 #include "core/css/CSSImportRule.h"
33 #include "core/css/CSSKeyframesRule.h" 33 #include "core/css/CSSKeyframesRule.h"
34 #include "core/css/CSSMediaRule.h" 34 #include "core/css/CSSMediaRule.h"
35 #include "core/css/CSSRuleList.h" 35 #include "core/css/CSSRuleList.h"
36 #include "core/css/CSSSelector.h" 36 #include "core/css/CSSSelector.h"
37 #include "core/css/CSSStyleRule.h" 37 #include "core/css/CSSStyleRule.h"
38 #include "core/css/CSSStyleSheet.h" 38 #include "core/css/CSSStyleSheet.h"
39 #include "core/css/CSSSupportsRule.h" 39 #include "core/css/CSSSupportsRule.h"
40 #include "core/css/SiblingTraversalStrategies.h"
41 #include "core/css/StylePropertySet.h" 40 #include "core/css/StylePropertySet.h"
42 #include "core/css/resolver/StyleResolver.h" 41 #include "core/css/resolver/StyleResolver.h"
43 #include "core/dom/shadow/ShadowRoot.h" 42 #include "core/dom/shadow/ShadowRoot.h"
44 #include "core/style/StyleInheritedData.h" 43 #include "core/style/StyleInheritedData.h"
45 44
46 namespace blink { 45 namespace blink {
47 46
48 ElementRuleCollector::ElementRuleCollector(const ElementResolveContext& context, 47 ElementRuleCollector::ElementRuleCollector(const ElementResolveContext& context,
49 const SelectorFilter& filter, ComputedStyle* style) 48 const SelectorFilter& filter, ComputedStyle* style)
50 : m_context(context) 49 : m_context(context)
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 { 258 {
260 SelectorChecker selectorChecker(m_mode); 259 SelectorChecker selectorChecker(m_mode);
261 SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_cont ext.element(), SelectorChecker::VisitedMatchEnabled); 260 SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_cont ext.element(), SelectorChecker::VisitedMatchEnabled);
262 context.elementStyle = m_style.get(); 261 context.elementStyle = m_style.get();
263 context.scope = scope; 262 context.scope = scope;
264 context.pseudoId = m_pseudoStyleRequest.pseudoId; 263 context.pseudoId = m_pseudoStyleRequest.pseudoId;
265 context.scrollbar = m_pseudoStyleRequest.scrollbar; 264 context.scrollbar = m_pseudoStyleRequest.scrollbar;
266 context.scrollbarPart = m_pseudoStyleRequest.scrollbarPart; 265 context.scrollbarPart = m_pseudoStyleRequest.scrollbarPart;
267 context.isUARule = m_matchingUARules; 266 context.isUARule = m_matchingUARules;
268 context.scopeContainsLastMatchedElement = m_scopeContainsLastMatchedElement; 267 context.scopeContainsLastMatchedElement = m_scopeContainsLastMatchedElement;
269 SelectorChecker::Match match = selectorChecker.match(context, DOMSiblingTrav ersalStrategy(), result); 268 SelectorChecker::Match match = selectorChecker.match(context, result);
270 if (match != SelectorChecker::SelectorMatches) 269 if (match != SelectorChecker::SelectorMatches)
271 return false; 270 return false;
272 if (m_pseudoStyleRequest.pseudoId != NOPSEUDO && m_pseudoStyleRequest.pseudo Id != result->dynamicPseudo) 271 if (m_pseudoStyleRequest.pseudoId != NOPSEUDO && m_pseudoStyleRequest.pseudo Id != result->dynamicPseudo)
273 return false; 272 return false;
274 return true; 273 return true;
275 } 274 }
276 275
277 void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, Cascad eOrder cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange) 276 void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, Cascad eOrder cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange)
278 { 277 {
279 if (m_canUseFastReject && m_selectorFilter.fastRejectSelector<RuleData::maxi mumIdentifierCount>(ruleData.descendantSelectorIdentifierHashes())) 278 if (m_canUseFastReject && m_selectorFilter.fastRejectSelector<RuleData::maxi mumIdentifierCount>(ruleData.descendantSelectorIdentifierHashes()))
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 int firstRuleIndex = -1, lastRuleIndex = -1; 342 int firstRuleIndex = -1, lastRuleIndex = -1;
344 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); 343 RuleRange ruleRange(firstRuleIndex, lastRuleIndex);
345 MatchRequest matchRequest(ruleSet); 344 MatchRequest matchRequest(ruleSet);
346 collectMatchingRules(matchRequest, ruleRange); 345 collectMatchingRules(matchRequest, ruleRange);
347 collectMatchingShadowHostRules(matchRequest, ruleRange); 346 collectMatchingShadowHostRules(matchRequest, ruleRange);
348 347
349 return !m_matchedRules.isEmpty(); 348 return !m_matchedRules.isEmpty();
350 } 349 }
351 350
352 } // namespace blink 351 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698