diff --git a/CHANGELOG b/CHANGELOG index 9d70cbe..60a3c6e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix a bug in the simulated hasAttribute for IE due to getAttributeNode sometimes returning null. [sam] + * Optimize Element.getStyle and add new Element.getOpacity method. Special case IE and Opera getStyle methods. Closes #7648. [Tobie Langel, Thomas Fuchs] * Optimize Element.setStyle and add new Element.setOpacity method, special case IE and Gecko opacity methods. Closes #7585. [savetheclocktower] diff --git a/src/dom.js b/src/dom.js index ab5b069..6168877 100644 --- a/src/dom.js +++ b/src/dom.js @@ -512,9 +512,10 @@ Object.extend(Element._attributeTranslations.values, { Element.Methods.Simulated = { hasAttribute: function(element, attribute) { - var t = Element._attributeTranslations; + var t = Element._attributeTranslations, node; attribute = t.names[attribute] || attribute; - return $(element).getAttributeNode(attribute).specified; + node = $(element).getAttributeNode(attribute); + return node && node.specified; } };