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

- old
+ new

@@ -379,12 +379,19 @@ Node.prototype.tagName = function() { return this.element.tagName; }; Node.prototype.isVisible = function(element) { - var style; + var map_name, style; if (element == null) { element = this.element; + } + 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 + "']"); + if (element == null) { + return false; + } } while (element) { style = window.getComputedStyle(element); if (style.display === 'none' || style.visibility === 'hidden' || parseFloat(style.opacity) === 0) { return false;