Skip to content

Commit 2344ff1

Browse files
committed
Tweaking IE driver obscured element algorithm
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.
1 parent f2afaed commit 2344ff1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cpp/iedriver/Element.cpp

+16-1
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ bool Element::IsObscured(LocationInfo* click_location,
376376
break;
377377
}
378378

379+
bool is_list_element_svg = false;
380+
CComPtr<ISVGElement> list_svg_element;
381+
hr = element_in_list->QueryInterface<ISVGElement>(&list_svg_element);
382+
if (SUCCEEDED(hr) && list_svg_element) {
383+
is_list_element_svg = true;
384+
}
385+
379386
bool is_list_element_displayed;
380387
Element list_element_wrapper(element_in_list,
381388
this->containing_window_handle_);
@@ -407,7 +414,15 @@ bool Element::IsObscured(LocationInfo* click_location,
407414
// may be technically obscuring this element, but manipulating
408415
// it with the pointer device has no effect, so it is effectively
409416
// not obscuring this element.
410-
is_obscured = true;
417+
// It is possible for the pointer-events value to be set to
418+
// values other than "none" or "auto" for SVG elements. Since
419+
// we are currently throwing up our hands with SVG elements,
420+
// if the value is anything other than "auto", assume the
421+
// element is not obscured.
422+
if (list_element_pointer_events_value == L"auto" &&
423+
!is_list_element_svg) {
424+
is_obscured = true;
425+
}
411426
}
412427
} else {
413428
// We were unable to retrieve the computed style, so we must assume

0 commit comments

Comments
 (0)