aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorrwldrn <waldron.rick@gmail.com>2011-01-05 13:32:59 -0500
committerrwldrn <waldron.rick@gmail.com>2011-01-05 13:32:59 -0500
commit8099cdce800d45109b961e3521fc0080e9a876c6 (patch)
treeb8887764de8ce38053fa4b6b021bfd2e15b4b713 /src
parentcbf591152c9f61381e552c9a15bb7c339f1451a9 (diff)
downloadjquery-8099cdce800d45109b961e3521fc0080e9a876c6.tar.gz
jquery-8099cdce800d45109b961e3521fc0080e9a876c6.zip
Bug #7608 elem.runtimeStyle throws exception in Opera
Diffstat (limited to 'src')
-rw-r--r--src/css.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/css.js b/src/css.js
index 8a83c6072..19c6342d2 100644
--- a/src/css.js
+++ b/src/css.js
@@ -263,8 +263,9 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
- var left, rsLeft,
+ var left,
ret = elem.currentStyle && elem.currentStyle[ name ],
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style;
// From the awesome hack by Dean Edwards
@@ -275,16 +276,19 @@ if ( document.documentElement.currentStyle ) {
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
left = style.left;
- rsLeft = elem.runtimeStyle.left;
// Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
style.left = name === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
- elem.runtimeStyle.left = rsLeft;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
}
return ret === "" ? "auto" : ret;