#1150 new
Mikhail Veltishchev

Element#getStyle width bug

Reported by Mikhail Veltishchev | September 29th, 2010 @ 07:08 AM

I found a problem with .getStyle('width') under Opera 10.62 (the latest one). This function returns incorrect results for an element which width was set to '100%'. I got '100px' under Opera and '100%' under another browser (e.g. Fx 3.6). I guess getStyle('width') returns percentage value, but appends 'px' to the end, that's wrong.

However, when I read style using .style.width, I got correct value.

Attachment contains simple html example with three buttons. First button sets width to textarea, second one obtains width using Prototype and third one uses .style.width to do the same thing. In Fx we got 100% in both cases, but in Opera we got '100px' and '100%'.

This was tested on Prototype 1.6.1 and latest 1.7 RC2.

NB: To get this sample working please edit the path to prototype library script.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Attachments

Pages