In the destructor of WebContentsImpl, all the RWH are first detached and then destroyed. This leads to RWHVs not being able to reset the text input state in the outer WebContentsImpl through a call to RenderWidgetHostViewBase::NotifyHostDelegateAboutShutdown(). Eventually, this triggers a DCHECK in WebContentsImpl::GetTextInputState due to a missing |view_with_active_text_input_| but a |text_input_state_| which is not none.
What steps will reproduce the problem?
(1) Create an empty app with <webview> permissions.
(2) Navigate the <webview> to a page with a text input field.
(3) Focus the text input field.
(4) Detach the <webview>.
What is the expected output?
The DCHECK in WebContentsImpl::GetTextInputState hits.
What do you see instead?
The DCHECK should not hit. This is due to WebContentsImpl not updating its input state.
Comment 1 by ekaramad@chromium.org
, Apr 11 2016