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

Unified Diff: third_party/WebKit/LayoutTests/editing/assert_selection.js

Issue 2686663004: Selection API: Selection.extend() should throw if rangeCount is 0. (Closed)
Patch Set: focus() -> collapse() Created 3 years, 10 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 | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/transpose-backslash-with-euc.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/assert_selection.js
diff --git a/third_party/WebKit/LayoutTests/editing/assert_selection.js b/third_party/WebKit/LayoutTests/editing/assert_selection.js
index 7d5a84cc6247d64f886da17c3167196fb014ea21..a66aa40318439a852ced410615da78961b6fb626 100644
--- a/third_party/WebKit/LayoutTests/editing/assert_selection.js
+++ b/third_party/WebKit/LayoutTests/editing/assert_selection.js
@@ -750,7 +750,8 @@ class Sample {
if (this.loadSelectionInTextArea(selection))
return;
this.selection_.collapse(selection.anchorNode, selection.anchorOffset);
- this.selection_.extend(selection.focusNode, selection.focusOffset);
+ if (this.selection_.rangeCount > 0)
+ this.selection_.extend(selection.focusNode, selection.focusOffset);
}
/**
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/transpose-backslash-with-euc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698