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

Unified Diff: Source/core/css/resolver/SharedStyleFinder.cpp

Issue 1270313002: Handle closed mode shadow for /deep/ and ::shadow selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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: Source/core/css/resolver/SharedStyleFinder.cpp
diff --git a/Source/core/css/resolver/SharedStyleFinder.cpp b/Source/core/css/resolver/SharedStyleFinder.cpp
index e1a5a7e069a570f4e3d76b30b495ac075e39be6c..afef6c1c54c322057cdc7561c63298ba1104767a 100644
--- a/Source/core/css/resolver/SharedStyleFinder.cpp
+++ b/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -266,6 +266,11 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const
return false;
}
+ ShadowRoot* root1 = element().containingShadowRoot();
+ ShadowRoot* root2 = candidate.containingShadowRoot();
+ if (root1 && root2 && root1->type() != root2->type())
+ return false;
+
if (document().containsValidityStyleRules()) {
if (candidate.isValidElement() != element().isValidElement())
return false;

Powered by Google App Engine
This is Rietveld 408576698