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

Unified Diff: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 2789363002: Styling slot fallback content with ::slotted()
Patch Set: rebase Created 3 years, 8 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
Index: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
index 56922e0a2f1c887cff4b2ff2ad9603fc971d86d1..13f4c2f3843d5459ea9edfe30ed369ad25107b68 100644
--- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -276,10 +276,13 @@ void ScopedStyleResolver::AddTreeBoundaryCrossingRules(
CSSStyleSheet* parent_style_sheet,
unsigned sheet_index) {
bool is_document_scope = GetTreeScope().RootNode().IsDocumentNode();
+
+ // ::slotted() rules have to be allowed for Document for styling fallback
+ // contents in <slot>.
if (author_rules.DeepCombinatorOrShadowPseudoRules().IsEmpty() &&
+ author_rules.SlottedPseudoElementRules().IsEmpty() &&
(is_document_scope ||
- (author_rules.ContentPseudoElementRules().IsEmpty() &&
- author_rules.SlottedPseudoElementRules().IsEmpty())))
+ (author_rules.ContentPseudoElementRules().IsEmpty())))
return;
if (!author_rules.DeepCombinatorOrShadowPseudoRules().IsEmpty())
@@ -288,11 +291,10 @@ void ScopedStyleResolver::AddTreeBoundaryCrossingRules(
RuleSet* rule_set_for_scope = RuleSet::Create();
AddRules(rule_set_for_scope,
author_rules.DeepCombinatorOrShadowPseudoRules());
+ AddRules(rule_set_for_scope, author_rules.SlottedPseudoElementRules());
- if (!is_document_scope) {
+ if (!is_document_scope)
AddRules(rule_set_for_scope, author_rules.ContentPseudoElementRules());
- AddRules(rule_set_for_scope, author_rules.SlottedPseudoElementRules());
- }
if (!tree_boundary_crossing_rule_set_) {
tree_boundary_crossing_rule_set_ = new CSSStyleSheetRuleSubSet();
« no previous file with comments | « third_party/WebKit/Source/core/css/SelectorChecker.cpp ('k') | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698