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

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

Issue 1498253002: Drop [LegacyInterfaceTypeChecking] for most of Selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests Created 5 years 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 5578cccf233a3cf544baec14ce8238e1264d8b72..940d173731789675676d70cf98978fcaad5f7e6d 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -204,13 +204,10 @@ int DOMSelection::rangeCount() const
void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionState)
{
- if (!m_frame)
- return;
+ ASSERT(node);
- if (!node) {
- m_frame->selection().clear();
+ if (!m_frame)
return;
- }
if (offset < 0) {
exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");

Powered by Google App Engine
This is Rietveld 408576698