Adding HRESULT check in IE driver
Fix for archived issue 7281 (https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/7281), basically an HRESULT is not getting checked.
@@ -1017,10 +1017,12 @@ bool Element::GetClickableViewPortLocation(const bool document_contains_frames,
this->GetContainingDocument(false, &doc);
int document_mode = DocumentHost::GetDocumentMode(doc);
CComPtr<IHTMLDocument3> document_element_doc;
- HRESULT hr = doc->QueryInterface<IHTMLDocument3>(&document_element_doc);
- if (SUCCEEDED(hr) && document_element_doc && document_mode > 5) {
CComPtr<IHTMLElement> document_element;
+ HRESULT hr = doc->QueryInterface<IHTMLDocument3>(&document_element_doc);
+ if (SUCCEEDED(hr) && document_element_doc) {
hr = document_element_doc->get_documentElement(&document_element);
+ }
+ if (SUCCEEDED(hr) && document_mode > 5 && document_element) {
CComPtr<IHTMLElement2> size_element;
hr = document_element->QueryInterface<IHTMLElement2>(&size_element);
size_element->get_clientHeight(&window_height);
