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

Method IsFocusable

cpp/iedriver/Element.cpp:238–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238bool Element::IsFocusable() {
239 LOG(TRACE) << "Entering Element::IsFocusable";
240
241 CComPtr<IHTMLBodyElement> body;
242 HRESULT hr = this->element_->QueryInterface<IHTMLBodyElement>(&body);
243 if (SUCCEEDED(hr) && body) {
244 // The <body> element is explicitly focusable.
245 return true;
246 }
247
248 CComPtr<IHTMLDocument2> doc;
249 this->GetContainingDocument(false, &doc);
250
251 CComPtr<IHTMLDocument3> document_element_doc;
252 hr = doc->QueryInterface<IHTMLDocument3>(&document_element_doc);
253 if (SUCCEEDED(hr) && document_element_doc) {
254 CComPtr<IHTMLElement> doc_element;
255 hr = document_element_doc->get_documentElement(&doc_element);
256 if (SUCCEEDED(hr) && doc_element && this->element_.IsEqualObject(doc_element)) {
257 // The document's documentElement is explicitly focusable.
258 return true;
259 }
260 }
261 return false;
262}
263
264bool Element::IsObscured(LocationInfo* click_location,
265 long* obscuring_element_index,

Callers

nothing calls this directly

Calls 2

GetContainingDocumentMethod · 0.95
LOGClass · 0.50

Tested by

no test coverage detected