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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1122593004: firstRectForCharacterRange(): don't fall over in an editable-less frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « LayoutTests/editing/input/text-input-controller-no-editable-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 6413b4695320d07018765c5d942c8a462e6f3177..bdc3632a0d750da53129cb622ee23ed74d3d8420 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1078,7 +1078,8 @@ bool WebLocalFrameImpl::firstRectForCharacterRange(unsigned location, unsigned l
length = 0;
Element* editable = frame()->selection().rootEditableElementOrDocumentElement();
- ASSERT(editable);
+ if (!editable)
+ return false;
RefPtrWillBeRawPtr<Range> range = PlainTextRange(location, location + length).createRange(*editable);
if (!range)
return false;
« no previous file with comments | « LayoutTests/editing/input/text-input-controller-no-editable-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698