Skip to content

Commit

Permalink
Tweaking IE driver obscured element algorithm
Browse files Browse the repository at this point in the history
The algorithm used by the IE driver to detect obscured elements checks
the value of the pointer-events CSS computed style property. This
property can have valid values of "auto" and "none" which affect whether
to consider an element "obscured." However, the property can also
contain other values for SVG elements. If the element in question is not
an SVG element, then values other than "none" and "auto" must be
ignored, and the element considered not to obscure the target element.
  • Loading branch information
jimevans committed Dec 20, 2018
1 parent f2afaed commit 2344ff1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cpp/iedriver/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ bool Element::IsObscured(LocationInfo* click_location,
break;
}

bool is_list_element_svg = false;
CComPtr<ISVGElement> list_svg_element;
hr = element_in_list->QueryInterface<ISVGElement>(&list_svg_element);
if (SUCCEEDED(hr) && list_svg_element) {
is_list_element_svg = true;
}

bool is_list_element_displayed;
Element list_element_wrapper(element_in_list,
this->containing_window_handle_);
Expand Down Expand Up @@ -407,7 +414,15 @@ bool Element::IsObscured(LocationInfo* click_location,
// may be technically obscuring this element, but manipulating
// it with the pointer device has no effect, so it is effectively
// not obscuring this element.
is_obscured = true;
// It is possible for the pointer-events value to be set to
// values other than "none" or "auto" for SVG elements. Since
// we are currently throwing up our hands with SVG elements,
// if the value is anything other than "auto", assume the
// element is not obscured.
if (list_element_pointer_events_value == L"auto" &&
!is_list_element_svg) {
is_obscured = true;
}
}
} else {
// We were unable to retrieve the computed style, so we must assume
Expand Down

0 comments on commit 2344ff1

Please sign in to comment.