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

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

Issue 788053002: Prefer lengthOfContents over countChildren (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DOMSelection.cpp
diff --git a/Source/core/editing/DOMSelection.cpp b/Source/core/editing/DOMSelection.cpp
index 6a8a63ea9014d7162c73f7c3fced15217a6cb5e4..99020f47a1a002ac2c15e50aef28a3ee97296b57 100644
--- a/Source/core/editing/DOMSelection.cpp
+++ b/Source/core/editing/DOMSelection.cpp
@@ -344,7 +344,7 @@ void DOMSelection::extend(Node* node, int offset, ExceptionState& exceptionState
exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
return;
}
- if (static_cast<unsigned>(offset) > (node->offsetInCharacters() ? node->lengthOfContents() : node->countChildren())) {
+ if (static_cast<unsigned>(offset) > node->lengthOfContents()) {
exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is larger than the given node's length.");
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698