Commit 58587b6f authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Remove unnecessary HasValidNamespaceForElements() check in Document::importNode().

It must not be possible to create elements with invalid namespace and
prefixes, and the DOM specification doesn't ask to check it.

This CL must have no behavior changes.

Bug: 812089
Change-Id: I598081857d10116a195ecb572c9c65588d6a7734
Reviewed-on: https://chromium-review.googlesource.com/923618Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537624}
parent 63bf6bc7
......@@ -1250,19 +1250,9 @@ Node* Document::importNode(Node* imported_node,
case kProcessingInstructionNode:
case kCommentNode:
case kDocumentTypeNode:
case kElementNode:
return imported_node->Clone(*this, clone_children);
case kElementNode: {
Element* old_element = ToElement(imported_node);
// FIXME: The following check might be unnecessary. Is it possible that
// oldElement has mismatched prefix/namespace?
if (!HasValidNamespaceForElements(old_element->TagQName())) {
exception_state.ThrowDOMException(
kNamespaceError, "The imported node has an invalid namespace.");
return nullptr;
}
return imported_node->Clone(*this, clone_children);
}
case kAttributeNode:
// The following code doesn't create an Attr with namespace. See
// crbug.com/812105.
......
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