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

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

Issue 2132343002: Make Custom Elements V1 work in HTML imports documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: imports-create tests checks the order of constructors Created 4 years, 5 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 72245da7b33fedbfa0c30e88044881ded386ef5e..5aab3b88c118fd1ea36fc9d6642a7a0028260599 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp
@@ -52,8 +52,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()) {
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