| OLD | NEW |
| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 TreeScope& treeScope = element->treeScope(); | 123 TreeScope& treeScope = element->treeScope(); |
| 124 | 124 |
| 125 // [skipped, because already checked] a) it's a UA rule | 125 // [skipped, because already checked] a) it's a UA rule |
| 126 // b) element is allowed to apply author rules | 126 // b) element is allowed to apply author rules |
| 127 if (elementApplyAuthorStyles) | 127 if (elementApplyAuthorStyles) |
| 128 return true; | 128 return true; |
| 129 // c) the rules comes from a scoped style sheet within the same tree scope | 129 // c) the rules comes from a scoped style sheet within the same tree scope |
| 130 if (!scopingNode || treeScope == scopingNode->treeScope()) | 130 if (!scopingNode || treeScope == scopingNode->treeScope()) |
| 131 return true; | 131 return true; |
| 132 // d) the rules comes from a scoped style sheet within an active shadow root
whose host is the given element | 132 // d) the rules comes from a scoped style sheet within an active shadow root
whose host is the given element |
| 133 if (element->isInShadowTree() && (behaviorAtBoundary & SelectorChecker::Scop
eIsShadowHost) && scopingNode == element->containingShadowRoot()->host()) | 133 if (SelectorChecker::isHostInItsShadowTree(*element, behaviorAtBoundary, sco
pingNode)) |
| 134 return true; | 134 return true; |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest
, RuleRange& ruleRange, SelectorChecker::BehaviorAtBoundary behaviorAtBoundary,
CascadeScope cascadeScope, CascadeOrder cascadeOrder) | 138 void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest
, RuleRange& ruleRange, SelectorChecker::BehaviorAtBoundary behaviorAtBoundary,
CascadeScope cascadeScope, CascadeOrder cascadeOrder) |
| 139 { | 139 { |
| 140 ASSERT(matchRequest.ruleSet); | 140 ASSERT(matchRequest.ruleSet); |
| 141 ASSERT(m_context.element()); | 141 ASSERT(m_context.element()); |
| 142 | 142 |
| 143 Element& element = *m_context.element(); | 143 Element& element = *m_context.element(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // information about "scope". | 342 // information about "scope". |
| 343 int firstRuleIndex = -1, lastRuleIndex = -1; | 343 int firstRuleIndex = -1, lastRuleIndex = -1; |
| 344 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); | 344 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); |
| 345 // FIXME: Verify whether it's ok to ignore CascadeScope here. | 345 // FIXME: Verify whether it's ok to ignore CascadeScope here. |
| 346 collectMatchingRules(MatchRequest(ruleSet), ruleRange, SelectorChecker::Stay
sWithinTreeScope); | 346 collectMatchingRules(MatchRequest(ruleSet), ruleRange, SelectorChecker::Stay
sWithinTreeScope); |
| 347 | 347 |
| 348 return m_matchedRules && !m_matchedRules->isEmpty(); | 348 return m_matchedRules && !m_matchedRules->isEmpty(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace WebCore | 351 } // namespace WebCore |
| OLD | NEW |