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

Unified Diff: Source/core/html/shadow/HTMLShadowElement.cpp

Issue 22852020: Only allow reprojecting shadows between ShadowRoots of the same type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Delete another test 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
« no previous file with comments | « Source/core/html/shadow/HTMLShadowElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/HTMLShadowElement.cpp
diff --git a/Source/core/html/shadow/HTMLShadowElement.cpp b/Source/core/html/shadow/HTMLShadowElement.cpp
index 4476f0233dee36ae3413380036a266872f461105..d8b857db5b2cd2d246e0c92e0ee6ef4cff1ba869 100644
--- a/Source/core/html/shadow/HTMLShadowElement.cpp
+++ b/Source/core/html/shadow/HTMLShadowElement.cpp
@@ -70,22 +70,15 @@ ShadowRoot* HTMLShadowElement::olderShadowRoot()
return older;
}
-static inline Element* hostForOldestAuthorShadowRoot(ShadowRoot* root)
-{
- return root && root->isOldestAuthorShadowRoot() ? root->host() : 0;
-}
-
-bool HTMLShadowElement::shouldSelect() const
-{
- Element* host = hostForOldestAuthorShadowRoot(containingShadowRoot());
- return !host || host->supportsShadowElementForUserAgentShadow();
-}
-
Node::InsertionNotificationRequest HTMLShadowElement::insertedInto(ContainerNode* insertionPoint)
{
- if (insertionPoint->inDocument() && !shouldSelect()) {
- String message = String::format("<shadow> doesn't work for %s element host.", containingShadowRoot()->host()->nodeName().utf8().data());
- document()->addConsoleMessage(RenderingMessageSource, WarningMessageLevel, message);
+ if (insertionPoint->inDocument()) {
+ // Warn if trying to reproject between user agent and author shadows.
+ ShadowRoot* root = containingShadowRoot();
+ if (root && root->olderShadowRoot() && root->type() != root->olderShadowRoot()->type()) {
+ String message = String::format("<shadow> doesn't work for %s element host.", root->host()->tagName().utf8().data());
+ document()->addConsoleMessage(RenderingMessageSource, WarningMessageLevel, message);
+ }
}
return InsertionPoint::insertedInto(insertionPoint);
}
« no previous file with comments | « Source/core/html/shadow/HTMLShadowElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698