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

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

Issue 560243002: Merge 181487 "Editing: Let Selection.collapse with null clears s..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2125/
Patch Set: Created 6 years, 3 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/collapse-null-expected.txt ('k') | Source/core/editing/Selection.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DOMSelection.cpp
===================================================================
--- Source/core/editing/DOMSelection.cpp (revision 181787)
+++ Source/core/editing/DOMSelection.cpp (working copy)
@@ -197,10 +197,14 @@
void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionState)
{
- ASSERT(node);
if (!m_frame)
return;
+ if (!node) {
+ m_frame->selection().clear();
+ return;
+ }
+
if (offset < 0) {
exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
return;
« no previous file with comments | « LayoutTests/editing/selection/collapse-null-expected.txt ('k') | Source/core/editing/Selection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698