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

Unified Diff: content/renderer/render_view_impl.cc

Issue 8413050: Fix selection related crash in debug build. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update Created 9 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index a0840fbc706d373b09da8aad02abd5eff1fdbbc0..6dc52f0e0121d0ee78671e182771e8bda71be114 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3263,6 +3263,11 @@ void RenderViewImpl::SyncSelectionIfRequired() {
} else {
offset = location;
text = frame->selectionAsText();
+ // http://crbug.com/101435
+ // In some case, frame->selectionAsText() returned text's length is not
+ // equal to the length returned from webview()->caretOrSelectionRange().
+ // So we have to set the range according to text.length().
+ range.set_end(range.start() + text.length());
James Su 2011/10/28 22:05:26 I'm wondering in which case they are not equal?
}
// Sometimes we get repeated didChangeSelection calls from webkit when
« 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