lib/capybara/poltergeist/client/compiled/agent.js in poltergeist-1.12.0 vs lib/capybara/poltergeist/client/compiled/agent.js in poltergeist-1.13.0

- old
+ new

@@ -95,11 +95,11 @@ PoltergeistAgent.prototype.afterUpload = function(id) { return this.get(id).removeAttribute('_poltergeist_selected'); }; PoltergeistAgent.prototype.clearLocalStorage = function() { - return localStorage.clear(); + return typeof localStorage !== "undefined" && localStorage !== null ? localStorage.clear() : void 0; }; return PoltergeistAgent; })(); @@ -387,10 +387,12 @@ rect = this.element.getBoundingClientRect(); return rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth; }; Node.prototype.isDisabled = function() { - return this.element.disabled || this.element.tagName === 'OPTION' && this.element.parentNode.disabled; + var xpath; + xpath = 'parent::optgroup[@disabled] | ancestor::select[@disabled] | parent::fieldset[@disabled] | ancestor::*[not(self::legend) or preceding-sibling::legend][parent::fieldset[@disabled]]'; + return this.element.disabled || document.evaluate(xpath, this.element, null, XPathResult.BOOLEAN_TYPE, null).booleanValue; }; Node.prototype.path = function() { var elements, selectors; elements = this.parentIds().reverse().map((function(_this) {