Ticket #3562: removeAttr.patch

File removeAttr.patch, 1.2 kB (added by scott.gonzalez, 16 months ago)
  • Users/sgonzale/Documents/workspace/jQuery

     
    111111// tweak $.attr for FF2 implementation 
    112112if (isFF2) { 
    113113        var attr = $.attr, 
     114                removeAttr = $.fn.removeAttr, 
     115                ariaNS = "http://www.w3.org/2005/07/aaa", 
    114116                ariaState = /^aria-/, 
    115117                ariaRole = /^wairole:/; 
    116118         
     
    123125                                : (attr.apply(this, arguments) || "").replace(ariaRole, "")) 
    124126                        : (ariaState.test(name) 
    125127                                ? (set 
    126                                         ? elem.setAttributeNS("http://www.w3.org/2005/07/aaa", 
     128                                        ? elem.setAttributeNS(ariaNS, 
    127129                                                name.replace(ariaState, "aaa:"), value) 
    128130                                        : attr.call(this, elem, name.replace(ariaState, "aaa:"))) 
    129131                                : attr.apply(this, arguments))); 
     
    128130                                        : attr.call(this, elem, name.replace(ariaState, "aaa:"))) 
    129131                                : attr.apply(this, arguments))); 
    130132        }; 
     133         
     134        $.fn.removeAttr = function(name) { 
     135                return (ariaState.test(name) 
     136                        ? this.each(function() { 
     137                                this.removeAttributeNS(ariaNS, name.replace(ariaState, "aaa:")); 
     138                        }) : removeAttr.call(this, name)); 
     139        }; 
    131140} 
    132141 
    133142//jQuery plugins