https://crbug.com/801388 was caused by changing this:
GetFrame().Selection().SetSelection(
SelectionInDOMTree::Builder().SetBaseAndExtent(range).Build(), 0);
to this:
GetFrame().Selection().SetSelection(
SelectionInDOMTree::Builder().SetBaseAndExtent(range).Build());
The problem is that the second code snippet calls FrameSelection::SetSelection() with no options parameter, which does the following:
void FrameSelection::SetSelection(const SelectionInDOMTree& selection) {
SetSelection(selection, SetSelectionOptions::Builder()
.SetShouldCloseTyping(true)
.SetShouldClearTypingStyle(true)
.Build());
}
We should probably make this method not do SetShouldCloseTyping(true) and SetShouldClearTypingStyle(true) since it's unexpected and has caused at least one regression. This will require modifying callers to set these options themselves, if necessary.
Comment 1 by yosin@chromium.org
, Jan 18 2018