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

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

Issue 2710593009: Selection API: add removeRange(). (Closed)
Patch Set: rebase 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
Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index d8358226054235f26e43529575d7152bdeef70ef..b19285ebdf988df34cb5022b386dccb7f546b0a4 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -588,6 +588,14 @@ void DOMSelection::clearCachedRangeIfSelectionOfDocument() {
frame()->selection().clearDocumentCachedRange();
}
+void DOMSelection::removeRange(Range* range) {
+ DCHECK(range);
+ if (!isAvailable())
+ return;
+ if (range == primaryRangeOrNull())
+ frame()->selection().clear();
+}
+
void DOMSelection::removeAllRanges() {
if (!isAvailable())
return;
« no previous file with comments | « third_party/WebKit/Source/core/editing/DOMSelection.h ('k') | third_party/WebKit/Source/core/editing/Selection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698