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

Unified Diff: Source/core/page/DOMSelection.cpp

Issue 212873002: Remove Selection.containsNode assertion that is not valid. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix spacing Created 6 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 | « LayoutTests/editing/selection/contains-node-cleared-document-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DOMSelection.cpp
diff --git a/Source/core/page/DOMSelection.cpp b/Source/core/page/DOMSelection.cpp
index 99c29c28c4001d42a10958fb1dfb1c8a0583d6e3..80edf63d5a7c41da4a4e42e6d8b6a3ab29e794c1 100644
--- a/Source/core/page/DOMSelection.cpp
+++ b/Source/core/page/DOMSelection.cpp
@@ -481,7 +481,8 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const
TrackExceptionState exceptionState;
bool nodeFullySelected = Range::compareBoundaryPoints(parentNode, nodeIndex, selectedRange->startContainer(), selectedRange->startOffset(), exceptionState) >= 0 && !exceptionState.hadException()
&& Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRange->endContainer(), selectedRange->endOffset(), exceptionState) <= 0 && !exceptionState.hadException();
- ASSERT(!exceptionState.hadException());
+ if (exceptionState.hadException())
+ return false;
if (nodeFullySelected)
return true;
« no previous file with comments | « LayoutTests/editing/selection/contains-node-cleared-document-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698