OOPIFs RenderWidgets/WebFrameWidgets do not know about page focus |
|||
Issue descriptionWe do track page focus for all renderers on the page, but the RenderWidgets and WebFrameWidgets do not get notified about the change. For context, see bug 688842 .
,
Nov 14
Does this apply to all child local roots or only to OOPIFs. In orderwords A1 --- B --- A2 The A1 main frame embeds B (an oopif) which embeds a frame in A. The A process will have a RenderWidget for A1 and A2, though A2 is not "an oopif" with respect to the main frame/view there. Would this problem apply equally to B and A2?
,
Nov 14
IIUC, the focus update should go to the common RenderView of A1 and A2 and the RenderFrameProxy and eventually swapped out RenderView of B. I think the RenderView of A1 & A2 only notifies the WebViewImpl and the WebFrameWidget of A2 (it gets one of those, right?) is not notified.
,
Dec 12
,
Dec 19
This looks like a scary piece of code that is likely to need to change along with fixing this bug. From render_widget_host_impl.cc:
// static
std::unique_ptr<RenderWidgetHostIterator>
RenderWidgetHost::GetRenderWidgetHosts() {
auto hosts = std::make_unique<RenderWidgetHostIteratorImpl>();
for (auto& it : g_routing_id_widget_map.Get()) {
RenderWidgetHostImpl* widget = it.second;
RenderViewHost* rvh = widget->GetRenderViewHost();
// If the widget is not for a main frame, add to |hosts|.
if (!rvh) {
hosts->Add(widget);
continue;
}
// If the widget is for a main frame, add only if active.
if (static_cast<RenderViewHostImpl*>(rvh)->is_active())
hosts->Add(widget);
}
return std::move(hosts);
}
,
Dec 19
Disregard #5. "Active" there does not refer to focus, but to "is not swapped out"
,
Dec 20
IIRC, the problem with page focus is that WebFrameWidgetImpl::SetFocus was not getting called at all. Today it might be a bit different since I see WidgetInputHandlerImpl actually calls into RenderWidget::OnSetFocus which should also propagate to WebFrameWidgetImpl (assuming browser properly calls focus methods on RenderWidgetHostImpls of OOPIFs). The other concern is whether we do need a WebFrameWidgetImpl::SetFocus at all. The use case seems to be for changing editable elements style (perhaps graying out) and IME. The former relies on getting the focused frame for the page so to call it on WebFrameWidget is perhaps not necessary. We could replicate the same logic in IME part, i.e., get the focused frame in the page. I think all in all we should be able to remove WebWidget::SetFocus to WebView. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ekaramad@chromium.org
, Feb 8 2017