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"; |