Skip to content

Commit

Permalink
Removing premature break statements in IE obscured element check
Browse files Browse the repository at this point in the history
When looping through the elements returned by elementsFromPoint, the driver
was calling a break statement early, preventing clear error messages for
which element is obscuring the element to be clicked.
  • Loading branch information
jimevans committed Nov 11, 2018
1 parent 2778509 commit b32e053
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cpp/iedriver/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ bool Element::IsObscured(LocationInfo* click_location,
}
}

bool is_obscured = false;
CComPtr<IHTMLDocument8> elements_doc;
hr = doc.QueryInterface<IHTMLDocument8>(&elements_doc);
if (FAILED(hr)) {
Expand All @@ -358,7 +357,7 @@ bool Element::IsObscured(LocationInfo* click_location,
return false;
}

long top_most_element_index = -1;
bool is_obscured = false;
CComPtr<IHTMLDOMChildrenCollection> elements_hit;
hr = elements_doc->elementsFromPoint(static_cast<float>(x),
static_cast<float>(y),
Expand Down Expand Up @@ -409,13 +408,11 @@ bool Element::IsObscured(LocationInfo* click_location,
// it with the pointer device has no effect, so it is effectively
// not obscuring this element.
is_obscured = true;
break;
}
} else {
// We were unable to retrieve the computed style, so we must assume
// the other element is obscuring this one.
is_obscured = true;
break;
}
} else {
// Repeating the immediate-child-of-inline-element hack from above for
Expand Down

0 comments on commit b32e053

Please sign in to comment.