Commit d4d982d2 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Remove Document::ImportContainerNodeChildren().

ContainerNode::CloneChildNodes() does the same thing.
This CL has no behavior changes.

Bug: 812089
Change-Id: Ida9fb4c6dbc34654b54e74285263f70411d50d36
Reviewed-on: https://chromium-review.googlesource.com/924108Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537577}
parent 9b527d07
......@@ -1237,21 +1237,6 @@ Text* Document::CreateEditingTextNode(const String& text) {
return Text::CreateEditingText(*this, text);
}
bool Document::ImportContainerNodeChildren(ContainerNode* old_container_node,
ContainerNode* new_container_node,
ExceptionState& exception_state) {
for (Node& old_child : NodeTraversal::ChildrenOf(*old_container_node)) {
Node* new_child = importNode(&old_child, true, exception_state);
if (exception_state.HadException())
return false;
new_container_node->AppendChild(new_child, exception_state);
if (exception_state.HadException())
return false;
}
return true;
}
Node* Document::importNode(Node* imported_node,
bool deep,
ExceptionState& exception_state) {
......@@ -1289,12 +1274,8 @@ Node* Document::importNode(Node* imported_node,
*old_element,
deep ? CloneChildrenFlag::kClone : CloneChildrenFlag::kSkip);
if (deep) {
if (!ImportContainerNodeChildren(old_element, new_element,
exception_state))
return nullptr;
}
if (deep)
old_element->CloneChildNodes(new_element);
return new_element;
}
case kAttributeNode:
......@@ -1314,12 +1295,9 @@ Node* Document::importNode(Node* imported_node,
"The node provided is a shadow root, which may not be imported.");
return nullptr;
}
DocumentFragment* old_fragment = ToDocumentFragment(imported_node);
DocumentFragment* new_fragment = createDocumentFragment();
if (deep && !ImportContainerNodeChildren(old_fragment, new_fragment,
exception_state))
return nullptr;
if (deep)
ToDocumentFragment(imported_node)->CloneChildNodes(new_fragment);
return new_fragment;
}
case kDocumentNode:
......
......@@ -1424,9 +1424,6 @@ class CORE_EXPORT Document : public ContainerNode,
virtual Document* CloneDocumentWithoutChildren();
bool ImportContainerNodeChildren(ContainerNode* old_container_node,
ContainerNode* new_container_node,
ExceptionState&);
void LockCompatibilityMode() { compatibility_mode_locked_ = true; }
ParserSynchronizationPolicy GetParserSynchronizationPolicy() const {
return parser_sync_policy_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment