diff --git a/CHANGELOG b/CHANGELOG index 4baa9a1..2294a59 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix simulated attribute reading for IE for "href", "src" and boolean attributes. [Mislav Marohnić, Thomas Fuchs] + * Form.Element.disable() will now call blur(), removed blur() call from Form.Element.enable(). Closes #6034. [tdd] * Optimize document.getElementsByClassName and finalize DOM performance optimization refactoring. Closes #6696. [Mislav Marohnić] diff --git a/src/dom.js b/src/dom.js index e0cdb95..f8e1ac9 100644 --- a/src/dom.js +++ b/src/dom.js @@ -523,16 +523,16 @@ Element._attributeTranslations = { } }; -with (Element._attributeTranslations.values) { - Object.extend(this, { - href: _getAttr, - src: _getAttr, - disabled: _flag, - checked: _flag, - readonly: _flag, - multiple: _flag - }); -}; +(function() { + Object.extend(this, { + href: this._getAttr, + src: this._getAttr, + disabled: this._flag, + checked: this._flag, + readonly: this._flag, + multiple: this._flag + }); +}).call(Element._attributeTranslations.values); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { diff --git a/test/unit/dom.html b/test/unit/dom.html index e7561f6..c8dc1ff 100644 --- a/test/unit/dom.html +++ b/test/unit/dom.html @@ -210,9 +210,18 @@ +
+ + + + +
-
+
@@ -725,17 +734,18 @@ }}, testElementReadAttribute: function() {with(this) { - assertEqual('test.html' , $('attributes_with_issues_1').readAttribute('href'), - 'NOTE: Due to a bug in IE\'s proprietary iFlags extension to getAttribute(), '+ - '"href" attribute lookup fails to grab the exact attribute value for protocols '+ - 'other than http(s), which makes this test fail when run locally (file protocol).'); + assertEqual('test.html' , $('attributes_with_issues_1').readAttribute('href')); assertEqual('L' , $('attributes_with_issues_1').readAttribute('accesskey')); assertEqual('50' , $('attributes_with_issues_1').readAttribute('tabindex')); assertEqual('a link' , $('attributes_with_issues_1').readAttribute('title')); ['href', 'accesskey', 'accesskey', 'title'].each(function(attr){ - assertEqual('' , $('attributes_with_issues_2').readAttribute(attr)); + assertEqual('' , $('attributes_with_issues_2').readAttribute(attr)); + }); + + ['checked','disabled','readonly','multiple'].each(function(attr){ + assertEqual(attr, $('attributes_with_issues_'+attr).readAttribute(attr)); }); var elements = $('custom_attributes').immediateDescendants();