diff --git a/src/node/js/node-view.js b/src/node/js/node-view.js index a854d963e45..b1c2d3eec8c 100644 --- a/src/node/js/node-view.js +++ b/src/node/js/node-view.js @@ -26,18 +26,23 @@ Y.mix(Y_Node.prototype, { /** * The implementation for showing nodes. - * Default is to toggle the style.display property. + * Default is to remove the hidden attribute. * @method _show * @protected * @chainable */ _show: function() { + this.removeAttribute('hidden'); + + // For back-compat we need to leave this in for browsers that + // do not visually hide a node via the hidden attribute + // and for users that check visibility based on style display. this.setStyle('display', ''); }, _isHidden: function() { - return Y.DOM.getStyle(this._node, 'display') === 'none'; + return Y.DOM.getAttribute(this._node, 'hidden') === 'true'; }, /** @@ -96,12 +101,17 @@ Y.mix(Y_Node.prototype, { /** * The implementation for hiding nodes. - * Default is to toggle the style.display property. + * Default is to set the hidden attribute to true. * @method _hide * @protected * @chainable */ _hide: function() { + this.setAttribute('hidden', true); + + // For back-compat we need to leave this in for browsers that + // do not visually hide a node via the hidden attribute + // and for users that check visibility based on style display. this.setStyle('display', 'none'); } }); @@ -145,4 +155,4 @@ Y.NodeList.importMethod(Y.Node.prototype, [ * @chainable */ 'toggleView' -]); +]); \ No newline at end of file