Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

setStyle() negative value and IE7 #2233

Closed
ibolmo opened this Issue · 4 comments

4 participants

Olmo Maldonado Christopher Pitt Dimitar Christoff Arian Stolwijk
Olmo Maldonado
Owner

(from Lighthouse)

Some softs developped with mootools calculate the height / margin, etc. of DOM elements and set them through the Element.setStyle() function.

Sometime, the sended value can be negative.
Modern browsers don't care but IE7 fired an error : "Member not found" at line 3566. (test on margin)

The solution could be to replace, in Element.setStyle declaration :

this.style[property] = value;

by

try {
    this.style[property] = value;   
}
catch(e){}

... or to set the nagative margin value to 0...


Example available here :
http://partikule.partikule.net/mootools_setstyle_bug/index.html
This example should be open with IE8 and IE7.

Olmo Maldonado
Owner

Moving to 1.5 since we can decide to throw an error during a dev environment or do as others and just ignore the call.

Dimitar Christoff
Collaborator

I don't at all like the idea that an error in props values is being swallowed. It is useful to get exceptions. Eg case:

element.setStyle('overflow-x', 'none'); // throws in IE

If the above just swallows it, it won't account for behaviour of element failing to change.

The obvious case here is undesired elastic transition loops through negative values which older versions of IE do not accept, for instance, height cannot be negative

Workaround can simply be try/catch block around your animation, not the setter

i'd label this bug as won't fix and close it for now.

Arian Stolwijk
Owner

agreed with @DimitarChristoff

Arian Stolwijk arian closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.