lib/watir-classic/element.rb in watir-classic-3.4.0 vs lib/watir-classic/element.rb in watir-classic-3.5.0

- old
+ new

@@ -249,15 +249,20 @@ # @macro exists def visible? # Now iterate up the DOM element tree and return false if any # parent element isn't visible assert_exists + visible_child = false object = @o while object begin - if object.currentstyle.invoke('visibility') =~ /^hidden$/i + visibility = object.currentstyle.invoke('visibility') + if visibility =~ /^visible$/i + visible_child = true + elsif !visible_child && visibility =~ /^hidden$/i return false end + if object.currentstyle.invoke('display') =~ /^none$/i return false end rescue WIN32OLERuntimeError end