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.
<html>
<head>
<!-- we're testing 1.6.1 and 1.7 RC2 versions -->
<script type="text/javascript" src="prototype17rc2.js"></script>
<!--<script type="text/javascript" src="prototype161.js"></script>-->
<title>Opera width style bug</title>
</head>
<body>
<div style="height: 50px; width: 400px">
<textarea id="qqq" width="80px" height="30px"></textarea>
</div>
<input value="proto set width" onclick="$('qqq').setStyle({width: '100%'});" type="button"/>
<input value="proto get width" onclick="alert('prototype width: '+$('qqq').getStyle('width'));" type="button"/>
<!-- we got '100px' here in alert -->
<input value="js get width" onclick="alert('style.width: '+$('qqq').style.width);" type="button"/>
<!-- and here we got '100%', that`s right -->
</body>
</html>
previous lighthouse ticket #1150 by Mikhail Veltishchev
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.