Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: third_party/WebKit/Source/core/dom/Range.cpp

Issue 2740293002: Range: surroundContents() should not check detached CharacterData node beforehand. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/Range/31684-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 37c2126240caed0aa99cfb54a7a9c6ce54adfc15..45618228a553fb8b3721f8e7b738d8269220a468 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1361,25 +1361,6 @@ void Range::surroundContents(Node* newParent, ExceptionState& exceptionState) {
break;
}
- // Raise a HierarchyRequestError if m_start.container() doesn't accept
- // children like newParent.
- Node* parentOfNewParent = m_start.container();
-
- // If m_start.container() is a character data node, it will be split and it
- // will be its parent that will need to accept newParent (or in the case of a
- // comment, it logically "would" be inserted into the parent, although this
- // will fail below for another reason).
- if (parentOfNewParent->isCharacterDataNode())
- parentOfNewParent = parentOfNewParent->parentNode();
-
- if (!parentOfNewParent) {
- exceptionState.throwDOMException(HierarchyRequestError,
- "The container node is a detached "
- "character data node; no parent node is "
- "available for insertion.");
- return;
- }
-
EventQueueScope scope;
// 3. Let fragment be the result of extracting context object.
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/Range/31684-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698