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

Unified Diff: sky/engine/core/css/ElementRuleCollector.cpp

Issue 833443003: Remove applyAuthorStyles flag. (Closed) Base URL: git@github.com:domokit/mojo.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 | « no previous file | sky/engine/core/css/SelectorChecker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/ElementRuleCollector.cpp
diff --git a/sky/engine/core/css/ElementRuleCollector.cpp b/sky/engine/core/css/ElementRuleCollector.cpp
index cc5fce119d22d830603fc228e42ddfb3b83abd9c..18fa5a573dc126be8f1e0b65fc223ca3f51b7ddb 100644
--- a/sky/engine/core/css/ElementRuleCollector.cpp
+++ b/sky/engine/core/css/ElementRuleCollector.cpp
@@ -82,21 +82,12 @@ void ElementRuleCollector::addElementStyleProperties(const StylePropertySet* pro
m_result.isCacheable = false;
}
-static bool rulesApplicableInCurrentTreeScope(const Element* element, const ContainerNode* scopingNode, bool elementApplyAuthorStyles)
+static bool rulesApplicableInCurrentTreeScope(const Element* element, const ContainerNode* scopingNode)
{
TreeScope& treeScope = element->treeScope();
-
- // [skipped, because already checked] a) it's a UA rule
- // b) element is allowed to apply author rules
- if (elementApplyAuthorStyles)
- return true;
- // c) the rules comes from a scoped style sheet within the same tree scope
- if (!scopingNode || treeScope == scopingNode->treeScope())
- return true;
- // d) the rules comes from a scoped style sheet within an active shadow root whose host is the given element
- if (SelectorChecker::isHostInItsShadowTree(*element, scopingNode))
- return true;
- return false;
+ return !scopingNode ||
+ treeScope == scopingNode->treeScope() ||
+ SelectorChecker::isHostInItsShadowTree(*element, scopingNode);
}
void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, RuleRange& ruleRange, SelectorChecker::ContextFlags contextFlags, CascadeScope cascadeScope, CascadeOrder cascadeOrder)
@@ -106,14 +97,7 @@ void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest
Element& element = *m_context.element();
- // Check whether other types of rules are applicable in the current tree scope. Criteria for this:
- // a) it's a UA rule
- // b) the tree scope allows author rules
- // c) the rules comes from a scoped style sheet within the same tree scope
- // d) the rules comes from a scoped style sheet within an active shadow root whose host is the given element
- // e) the rules can cross boundaries
- // b)-e) is checked in rulesApplicableInCurrentTreeScope.
- if (!m_matchingUARules && !rulesApplicableInCurrentTreeScope(&element, matchRequest.scope, matchRequest.elementApplyAuthorStyles))
+ if (!m_matchingUARules && !rulesApplicableInCurrentTreeScope(&element, matchRequest.scope))
return;
// We need to collect the rules for id, class, tag, and everything else into a buffer and
« no previous file with comments | « no previous file | sky/engine/core/css/SelectorChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698