Bug 1081039 - cloneNode on a custom element should call createdCallback if cloned in a document with a custom element definition. r=smaug

This commit is contained in:
William Chen
2014-12-22 18:19:08 -08:00
parent 649dfd4da1
commit b3789d6fc4
11 changed files with 202 additions and 56 deletions

View File

@@ -266,13 +266,7 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
return NS_ERROR_OUT_OF_MEMORY;
}
// Element may be unresolved at this point.
doc->RegisterUnresolvedElement(*aResult);
// Try to enqueue a created callback. The custom element data will be set
// and created callback will be enqueued if the custom element type
// has already been registered.
doc->EnqueueLifecycleCallback(nsIDocument::eCreated, *aResult);
doc->SetupCustomElement(*aResult, kNameSpaceID_XHTML);
return NS_OK;
}