Index: third_party/WebKit/Source/core/dom/Range.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp |
index 57de739ef4e668c656ffeae75f5766f02a518a25..37c2126240caed0aa99cfb54a7a9c6ce54adfc15 100644 |
--- a/third_party/WebKit/Source/core/dom/Range.cpp |
+++ b/third_party/WebKit/Source/core/dom/Range.cpp |
@@ -1380,16 +1380,13 @@ void Range::surroundContents(Node* newParent, ExceptionState& exceptionState) { |
return; |
} |
- if (!parentOfNewParent->childTypeAllowed(newParent->getNodeType())) { |
- exceptionState.throwDOMException(HierarchyRequestError, |
- "The node provided is of type '" + |
- newParent->nodeName() + |
- "', which may not be inserted here."); |
- return; |
- } |
- |
EventQueueScope scope; |
+ // 3. Let fragment be the result of extracting context object. |
+ DocumentFragment* fragment = extractContents(exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
+ |
// 4. If newParent has children, replace all with null within newParent. |
while (Node* n = newParent->firstChild()) { |
toContainerNode(newParent)->removeChild(n, exceptionState); |
@@ -1397,11 +1394,6 @@ void Range::surroundContents(Node* newParent, ExceptionState& exceptionState) { |
return; |
} |
- // 3. Let fragment be the result of extracting context object. |
- DocumentFragment* fragment = extractContents(exceptionState); |
- if (exceptionState.hadException()) |
- return; |
- |
// 5. If newParent has children, replace all with null within newParent. |
insertNode(newParent, exceptionState); |
if (exceptionState.hadException()) |