Commit b01aeaab authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

Remove redundant conditional in LayutSelection::UpdateLayoutObjectState

That condition is used to consider "if LayoutObject state is still
same but offset is changed, we should invalidate it".
However since |new_selected_map| includes start and end LO, even if
 we don't invalidate in this loop, we invalidate them in just below
 loop.

Bug: 739062
Change-Id: I6ab6770565b8852260a226f208923d3b20492af9
Reviewed-on: https://chromium-review.googlesource.com/578968
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488583}
parent 0b5dc578
......@@ -328,11 +328,7 @@ static void UpdateLayoutObjectState(const SelectionMarkingRange& new_range,
LayoutObject* obj = pair.key;
SelectionState new_selection_state = obj->GetSelectionState();
SelectionState old_selection_state = pair.value;
if (new_selection_state != old_selection_state ||
(new_range.StartLayoutObject() == obj &&
new_range.StartOffset() != old_range.StartOffset()) ||
(new_range.EndLayoutObject() == obj &&
new_range.EndOffset() != old_range.EndOffset())) {
if (new_selection_state != old_selection_state) {
obj->SetShouldInvalidateSelection();
new_selected_map.object_map.erase(obj);
}
......
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