Commit b1601a7a authored by yoichio's avatar yoichio Committed by Commit Bot

Return null SelectionPaintRange if no LayoutObject.

There is a case that CreateVisiblePosition returns {start, null} range
 in LayoutSelection::CalcSelection.
VisibleSelection and EphemeralRange constructors prohibit such case
 but it is by DCHECK so we need cover on Release build failure.

BUG=739996

Review-Url: https://codereview.chromium.org/2968363002
Cr-Commit-Position: refs/heads/master@{#485184}
parent 8a22a574
...@@ -322,6 +322,8 @@ static SelectionPaintRange CalcSelectionPaintRange( ...@@ -322,6 +322,8 @@ static SelectionPaintRange CalcSelectionPaintRange(
DCHECK(start_layout_object); DCHECK(start_layout_object);
DCHECK(end_layout_object); DCHECK(end_layout_object);
DCHECK(start_layout_object->View() == end_layout_object->View()); DCHECK(start_layout_object->View() == end_layout_object->View());
if (!start_layout_object || !end_layout_object)
return SelectionPaintRange();
return SelectionPaintRange(start_layout_object, return SelectionPaintRange(start_layout_object,
start_pos.ComputeEditingOffset(), start_pos.ComputeEditingOffset(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment