| 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..0be1a2ae870efbbf18f15e289beedfc639afae6e 100644
|
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
|
| @@ -82,8 +82,13 @@ 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 (frame() && frame()->document() &&
|
| + focusedElement != frame()->document()->focusedElement())
|
| + UseCounter::count(frame(), UseCounter::SelectionFuncionsChangeFocus);
|
| }
|
|
|
| const VisibleSelection& DOMSelection::visibleSelection() const {
|
|
|