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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 if (ruleData.selector()->m_match == CSSSelector::Tag && !SelectorChecker ::tagMatches(m_context.element(), ruleData.selector()->tagQName())) 214 if (ruleData.selector()->m_match == CSSSelector::Tag && !SelectorChecker ::tagMatches(m_context.element(), ruleData.selector()->tagQName()))
215 return false; 215 return false;
216 SelectorCheckerFastPath selectorCheckerFastPath(ruleData.selector(), m_c ontext.element()); 216 SelectorCheckerFastPath selectorCheckerFastPath(ruleData.selector(), m_c ontext.element());
217 if (!selectorCheckerFastPath.matchesRightmostAttributeSelector()) 217 if (!selectorCheckerFastPath.matchesRightmostAttributeSelector())
218 return false; 218 return false;
219 219
220 return selectorCheckerFastPath.matches(); 220 return selectorCheckerFastPath.matches();
221 } 221 }
222 222
223 // Slow path. 223 // Slow path.
224 SelectorChecker selectorChecker(document(), m_mode); 224 SelectorChecker selectorChecker(&document(), m_mode);
225 SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_cont ext.element(), SelectorChecker::VisitedMatchEnabled); 225 SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_cont ext.element(), SelectorChecker::VisitedMatchEnabled);
226 context.elementStyle = m_style.get(); 226 context.elementStyle = m_style.get();
227 context.scope = scope; 227 context.scope = scope;
228 context.pseudoId = m_pseudoStyleRequest.pseudoId; 228 context.pseudoId = m_pseudoStyleRequest.pseudoId;
229 context.scrollbar = m_pseudoStyleRequest.scrollbar; 229 context.scrollbar = m_pseudoStyleRequest.scrollbar;
230 context.scrollbarPart = m_pseudoStyleRequest.scrollbarPart; 230 context.scrollbarPart = m_pseudoStyleRequest.scrollbarPart;
231 context.behaviorAtBoundary = m_behaviorAtBoundary; 231 context.behaviorAtBoundary = m_behaviorAtBoundary;
232 SelectorChecker::Match match = selectorChecker.match(context, dynamicPseudo, DOMSiblingTraversalStrategy()); 232 SelectorChecker::Match match = selectorChecker.match(context, dynamicPseudo, DOMSiblingTraversalStrategy());
233 if (match != SelectorChecker::SelectorMatches) 233 if (match != SelectorChecker::SelectorMatches)
234 return false; 234 return false;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 m_behaviorAtBoundary = SelectorChecker::StaysWithinTreeScope; 317 m_behaviorAtBoundary = SelectorChecker::StaysWithinTreeScope;
318 int firstRuleIndex = -1, lastRuleIndex = -1; 318 int firstRuleIndex = -1, lastRuleIndex = -1;
319 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); 319 RuleRange ruleRange(firstRuleIndex, lastRuleIndex);
320 // FIXME: Verify whether it's ok to ignore CascadeScope here. 320 // FIXME: Verify whether it's ok to ignore CascadeScope here.
321 collectMatchingRules(MatchRequest(ruleSet), ruleRange); 321 collectMatchingRules(MatchRequest(ruleSet), ruleRange);
322 322
323 return m_matchedRules && !m_matchedRules->isEmpty(); 323 return m_matchedRules && !m_matchedRules->isEmpty();
324 } 324 }
325 325
326 } // namespace WebCore 326 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/ElementRuleCollector.h ('k') | Source/core/css/PropertySetCSSStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698