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

Unified Diff: Source/core/css/ElementRuleCollector.cpp

Issue 829393005: Don't match empty style rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/win/fast/css/first-letter-first-line-hover-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/ElementRuleCollector.cpp
diff --git a/Source/core/css/ElementRuleCollector.cpp b/Source/core/css/ElementRuleCollector.cpp
index ed245341ee8f55b0216a8778fc6ba3333af4da53..5fa2a5f9280f1f3511728f9877581edc84c406a3 100644
--- a/Source/core/css/ElementRuleCollector.cpp
+++ b/Source/core/css/ElementRuleCollector.cpp
@@ -280,12 +280,14 @@ void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, Cascad
return;
StyleRule* rule = ruleData.rule();
+
+ // If the rule has no properties to apply, then ignore it in the non-debug mode.
+ const StylePropertySet& properties = rule->properties();
+ if (properties.isEmpty() && !matchRequest.includeEmptyRules)
+ return;
+
SelectorChecker::MatchResult result;
if (ruleMatches(ruleData, matchRequest.scope, &result)) {
- // If the rule has no properties to apply, then ignore it in the non-debug mode.
- const StylePropertySet& properties = rule->properties();
- if (properties.isEmpty() && !matchRequest.includeEmptyRules)
- return;
// FIXME: Exposing the non-standard getMatchedCSSRules API to web is the only reason this is needed.
if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin())
return;
« no previous file with comments | « LayoutTests/platform/win/fast/css/first-letter-first-line-hover-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698