MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / DocumentComplete

Method DocumentComplete

cpp/iedriver/Browser.cpp:187–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void __stdcall Browser::DocumentComplete(IDispatch* pDisp, VARIANT* URL) {
188 LOG(TRACE) << "Entering Browser::DocumentComplete";
189
190 // Flag the browser as navigation having started.
191 this->is_navigation_started_ = true;
192
193 // DocumentComplete fires last for the top-level frame. If it fires
194 // for the top-level frame and the focused_frame_window_ member variable
195 // is not NULL, we assume we have navigated from within a frameset to a
196 // link that has a target of "_top", which replaces the frameset with the
197 // target page. On a top-level navigation, we are supposed to reset the
198 // focused frame to the top-level, so we do that here.
199 // NOTE: This is a possible source of unreliability if the above
200 // assumptions turn out to be wrong and/or the event firing doesn't work
201 // the way we expect it to.
202 CComPtr<IDispatch> dispatch(this->browser_);
203 if (dispatch.IsEqualObject(pDisp)) {
204 if (this->focused_frame_window() != NULL) {
205 LOG(DEBUG) << "DocumentComplete happened from within a frameset";
206 this->SetFocusedFrameByElement(NULL);
207 }
208 }
209}
210
211void Browser::InitiateBrowserReattach() {
212 LOG(TRACE) << "Entering Browser::InitiateBrowserReattach";

Callers

nothing calls this directly

Calls 3

focused_frame_windowMethod · 0.80
LOGClass · 0.50

Tested by

no test coverage detected