lib/capybara/poltergeist/client/agent.coffee in poltergeist-1.8.1 vs lib/capybara/poltergeist/client/agent.coffee in poltergeist-1.9.0

- old
+ new

@@ -255,9 +255,15 @@ tagName: -> @element.tagName isVisible: (element = @element) -> + #if an area element, check visibility of relevant image + if element.tagName == 'AREA' + map_name = document.evaluate('./ancestor::map/@name', element, null, XPathResult.STRING_TYPE, null).stringValue + element = document.querySelector("img[usemap='##{map_name}']") + return false unless element? + while (element) style = window.getComputedStyle(element) return false if style.display == 'none' or style.visibility == 'hidden' or parseFloat(style.opacity) == 0