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

Unified Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 23060029: Only allow reprojecting shadows between ShadowRoots of the same type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Base files missing Created 7 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/dom/shadow/ElementShadow.cpp
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index b6eef01639011b239d501a890805a0260d668d27..bdd09138e2ab2ac36e66f37442f3975d02156c86 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -234,12 +234,12 @@ void ElementShadow::distribute()
HTMLShadowElement* shadowElement = activeShadowInsertionPoints[i - 1];
ShadowRoot* root = shadowElement->containingShadowRoot();
ASSERT(root);
- if (!shadowElement->shouldSelect()) {
- if (root->olderShadowRoot())
+ if (root->olderShadowRoot()) {
+ // Disallow reprojecting UA shadows into author shadows.
+ if (root->olderShadowRoot()->type() == root->type()) {
+ distributeNodeChildrenTo(shadowElement, root->olderShadowRoot());
root->olderShadowRoot()->ensureScopeDistribution()->setInsertionPointAssignedTo(shadowElement);
- } else if (root->olderShadowRoot()) {
- distributeNodeChildrenTo(shadowElement, root->olderShadowRoot());
- root->olderShadowRoot()->ensureScopeDistribution()->setInsertionPointAssignedTo(shadowElement);
+ }
} else {
distributeSelectionsTo(shadowElement, pool, distributed);
}

Powered by Google App Engine
This is Rietveld 408576698