Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
index 086a79881696112c584d0d849db0724672006d89..f101593c265bd269854e7b9bafd650e18f36be42 100644 |
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
@@ -1360,6 +1360,13 @@ void WebLocalFrameImpl::setCaretVisible(bool visible) |
frame()->selection().setCaretVisible(visible); |
} |
+void WebLocalFrameImpl::clearFocus() |
+{ |
+ // This uses setFocusedElement rather than setFocusedFrame so that blur |
+ // events are properly dispatched on any currently focused elements. |
+ frame()->page()->focusController().setFocusedElement(nullptr, nullptr); |
+} |
+ |
VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoint& pointInViewport) |
{ |
return visiblePositionForContentsPoint(frame()->view()->viewportToContents(pointInViewport), frame()); |