Ticket #9372 (closed bug: wontfix)
cssProps properties from object prototype chain causes errors
|Reported by:||xelaris||Owned by:||xelaris|
There is an issue with methods added to Object.prototype in combination with any function, which ends up in a call to jQuery.css().
If a function is added to every object's prototype chain, calling .css(map), for example, ends up with a call of jQuery.css( elem, name, extra ) where the parameter name becomes the name of the function from the prototype chain. The name is obviously expected to be a string.
Through the line
name = jQuery.cssProps[ name ] || name;
name becomes a function reference, because jQuery.cssProps[ name ] returns the function form the protoype chain.
In the following the function reference is passed to curCSS( elem, name ) where name.replace accordingly causes an error.
Therefore an hasOwnProperty() check is missing.
I suggest something like
name = jQuery.cssProps.hasOwnProperty( name ) && jQuery.cssProps[ name ] || name;
This issue also exists in the current git version.
It can be reproduced whith jsfiddle under: http://jsfiddle.net/jvXMj/
- Priority changed from undecided to low
- Component changed from unfiled to misc