summaryrefslogtreecommitdiff
path: root/dom/base/nsNodeUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsNodeUtils.cpp')
-rw-r--r--dom/base/nsNodeUtils.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/base/nsNodeUtils.cpp b/dom/base/nsNodeUtils.cpp
index cd60eb2806..fe68a871b1 100644
--- a/dom/base/nsNodeUtils.cpp
+++ b/dom/base/nsNodeUtils.cpp
@@ -648,6 +648,17 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
}
}
+ // TODO: update this if we choose to land bug 1393806.
+ if (aDeep && !aClone && aNode->IsElement()) {
+ if (ShadowRoot* shadowRoot = aNode->AsElement()->GetShadowRoot()) {
+ nsCOMPtr<nsINode> child;
+ rv = CloneAndAdopt(shadowRoot, aClone, aDeep, nodeInfoManager,
+ aReparentScope, aNodesWithProperties, clone,
+ getter_AddRefs(child));
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+ }
+
// Cloning template element.
if (aDeep && aClone && IsTemplateElement(aNode)) {
DocumentFragment* origContent =