| 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. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the | 147 // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the |
| 148 // only reason this is needed. | 148 // only reason this is needed. |
| 149 if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin()) | 149 if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin()) |
| 150 continue; | 150 continue; |
| 151 | 151 |
| 152 StyleRule* rule = ruleData.rule(); | 152 StyleRule* rule = ruleData.rule(); |
| 153 | 153 |
| 154 // If the rule has no properties to apply, then ignore it in the non-debug | 154 // If the rule has no properties to apply, then ignore it in the non-debug |
| 155 // mode. | 155 // mode. |
| 156 const StylePropertySet& properties = rule->properties(); | 156 if (!rule->shouldConsiderForMatchingRules(m_includeEmptyRules)) |
| 157 if (properties.isEmpty() && !m_includeEmptyRules) | |
| 158 continue; | 157 continue; |
| 159 | 158 |
| 160 SelectorChecker::MatchResult result; | 159 SelectorChecker::MatchResult result; |
| 161 context.selector = &ruleData.selector(); | 160 context.selector = &ruleData.selector(); |
| 162 if (!checker.match(context, result)) { | 161 if (!checker.match(context, result)) { |
| 163 rejected++; | 162 rejected++; |
| 164 continue; | 163 continue; |
| 165 } | 164 } |
| 166 if (m_pseudoStyleRequest.pseudoId != PseudoIdNone && | 165 if (m_pseudoStyleRequest.pseudoId != PseudoIdNone && |
| 167 m_pseudoStyleRequest.pseudoId != result.dynamicPseudo) { | 166 m_pseudoStyleRequest.pseudoId != result.dynamicPseudo) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // should not see the element's treescope. Because RuleSet has no information | 365 // should not see the element's treescope. Because RuleSet has no information |
| 367 // about "scope". | 366 // about "scope". |
| 368 MatchRequest matchRequest(ruleSet); | 367 MatchRequest matchRequest(ruleSet); |
| 369 collectMatchingRules(matchRequest); | 368 collectMatchingRules(matchRequest); |
| 370 collectMatchingShadowHostRules(matchRequest); | 369 collectMatchingShadowHostRules(matchRequest); |
| 371 | 370 |
| 372 return !m_matchedRules.isEmpty(); | 371 return !m_matchedRules.isEmpty(); |
| 373 } | 372 } |
| 374 | 373 |
| 375 } // namespace blink | 374 } // namespace blink |
| OLD | NEW |