| 236 | } |
| 237 | |
| 238 | bool 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 | |
| 264 | bool Element::IsObscured(LocationInfo* click_location, |
| 265 | long* obscuring_element_index, |
nothing calls this directly
no test coverage detected