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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP Created 5 years 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 d42cda26de9c30f149ebc6a22331dccf63517f2d..87a105c37e45d007dc31ee7b4b77eacaa1d2707d 100644
--- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -207,7 +207,8 @@ static void addRules(RuleSet* ruleSet, const WillBeHeapVector<MinimalRuleData>&
void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRules, CSSStyleSheet* parentStyleSheet, unsigned sheetIndex)
{
bool isDocumentScope = treeScope().rootNode().isDocumentNode();
- if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() && (isDocumentScope || authorRules.shadowDistributedRules().isEmpty()))
+ if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()
+ && (isDocumentScope || (authorRules.shadowDistributedRules().isEmpty() && authorRules.shadowSlottedRules().isEmpty())))
return;
if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty())
@@ -216,8 +217,10 @@ void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRule
OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create();
addRules(ruleSetForScope.get(), authorRules.deepCombinatorOrShadowPseudoRules());
- if (!isDocumentScope)
+ if (!isDocumentScope) {
addRules(ruleSetForScope.get(), authorRules.shadowDistributedRules());
+ addRules(ruleSetForScope.get(), authorRules.shadowSlottedRules());
+ }
if (!m_treeBoundaryCrossingRuleSet) {
m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet());

Powered by Google App Engine
This is Rietveld 408576698