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

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

Issue 451403002: Range.deleteContents shouldn't throw HierarchyRequestError on doctype (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take review comment into consideration. Created 6 years, 4 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 | « Source/core/dom/Range.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 0b87825708b4dbcb40361fdc0e8c4fc0b6beb687..efa129d85a14badec6a8da30f5838c7cf5a7aa53 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -462,9 +462,7 @@ bool Range::boundaryPointsValid() const
void Range::deleteContents(ExceptionState& exceptionState)
{
- checkDeleteExtract(exceptionState);
- if (exceptionState.hadException())
- return;
+ ASSERT(boundaryPointsValid());
{
EventQueueScope eventQueueScope;
@@ -800,7 +798,7 @@ PassRefPtrWillBeRawPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType
PassRefPtrWillBeRawPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionState)
{
- checkDeleteExtract(exceptionState);
+ checkExtractPrecondition(exceptionState);
if (exceptionState.hadException())
return nullptr;
@@ -1298,7 +1296,7 @@ void Range::setStartBefore(Node* refNode, ExceptionState& exceptionState)
setStart(refNode->parentNode(), refNode->nodeIndex(), exceptionState);
}
-void Range::checkDeleteExtract(ExceptionState& exceptionState)
+void Range::checkExtractPrecondition(ExceptionState& exceptionState)
{
ASSERT(boundaryPointsValid());
« no previous file with comments | « Source/core/dom/Range.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698