Creating a child frame results in the RenderFrame initializing (and creating RenderFrameObservers) before the LocalFrame has been created. That doesn't happen when creating the main frame or provisional frames.
Today's CreateChildFrame:
LocalFrameClientImpl::CreateFrame
. WebLocalFrameImpl::CreateChildFrame
. RenderFrameImpl::CreateChildFrame
. child_render_frame->Initialize
. child_web_local_frame->InitializeCoreFrame
I propose that we create a new WebFrameClient::InitializeFrame function so that we have the following:
LocalFrameClientImpl::CreateFrame
. WebLocalFrameImpl::CreateChildFrame
. RenderFrameImpl::CreateChildFrame
. child_web_local_frame->InitializeCoreFrame()
. child_client->InitializeFrame()
Comment 1 by jkarlin@chromium.org
, May 3 2018