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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase wip Created 4 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: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
index a9e7d5cd80b3ae9db6a1ff58feab377d277472db..db82d7bbadc7ea20a9d938449f7c0f39c7d5e6be 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
@@ -55,8 +55,10 @@ static String errorMessageForConstructorResult(Element* element,
if (element->parentNode())
return "The result must not have a parent";
// 6.1.7. If result's node document is not document, then throw a NotSupportedError.
- if (&element->document() != &document)
+ if (&element->document() != &document
+ && element->document().contextDocument() != document.contextDocument()) {
dominicc (has gone to gerrit) 2016/08/19 04:54:11 I'm not sure this is right. Why would we disallow
kochi 2016/08/22 07:37:34 I'm not sure I understand "unrelated document" her
return "The result must be in the same document";
+ }
// 6.1.8. If result's namespace is not the HTML namespace, then throw a NotSupportedError.
if (element->namespaceURI() != HTMLNames::xhtmlNamespaceURI)
return "The result must have HTML namespace";

Powered by Google App Engine
This is Rietveld 408576698