| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index deee5480624927d91392edcc4f98dc3d9a510024..bd9e469964ba2480908b2c4acd3679f9ece85571 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -4735,6 +4735,13 @@ void WebContentsImpl::SetAsFocusedWebContentsIfNecessary() {
|
| // and focus this contents to activate it.
|
| if (old_contents)
|
| old_contents->GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(false);
|
| +
|
| + // Make sure the outer web contents knows our frame is focused. Otherwise, the
|
| + // outer renderer could have the element before or after the frame element
|
| + // focused which would return early without actually advancing focus.
|
| + if (GetRenderManager()->GetProxyToOuterDelegate())
|
| + GetRenderManager()->GetProxyToOuterDelegate()->SetFocusedFrame();
|
| +
|
| GetMainFrame()->GetRenderWidgetHost()->SetPageFocus(true);
|
| GetOutermostWebContents()->node_->SetFocusedWebContents(this);
|
| }
|
|
|