Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| index b19285ebdf988df34cb5022b386dccb7f546b0a4..c4202be576ea902eda0fa0c576ab3d3867a0c0c5 100644 |
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| @@ -82,8 +82,12 @@ void DOMSelection::updateFrameSelection(const SelectionInDOMTree& selection, |
| // TODO(tkent): Specify FrameSelection::DoNotSetFocus. crbug.com/690272 |
| bool didSet = frameSelection.setSelectionDeprecated(selection); |
| cacheRangeIfSelectionOfDocument(newCachedRange); |
| - if (didSet) |
| - frameSelection.didSetSelectionDeprecated(); |
| + if (!didSet) |
| + return; |
| + Element* focusedElement = frame()->document()->focusedElement(); |
| + frameSelection.didSetSelectionDeprecated(); |
| + if (focusedElement != frame()->document()->focusedElement()) |
|
tkent
2017/02/28 07:14:42
This line crashed because frame() or frame()->docu
|
| + UseCounter::count(frame(), UseCounter::SelectionFuncionsChangeFocus); |
| } |
| const VisibleSelection& DOMSelection::visibleSelection() const { |