diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2014-12-18 18:36:58 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2014-12-24 02:46:09 +0300 |
commit | dac716ca65a83bab2449ffa35c43b4b52e26a0c1 (patch) | |
tree | e89118e066d1615c12622c038ff302a44442652c /src/css | |
parent | d9d8906cfdd05a6163b0a6791f7ab4433951eacd (diff) | |
download | jquery-dac716ca65a83bab2449ffa35c43b4b52e26a0c1.tar.gz jquery-dac716ca65a83bab2449ffa35c43b4b52e26a0c1.zip |
CSS: simplify hack of css getter for the computed values
Ref gh-1906
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/curCSS.js | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 0b8f25997..c3210f186 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -72,7 +72,7 @@ if ( window.getComputedStyle ) { }; curCSS = function( elem, name, computed ) { - var left, rs, rsLeft, ret, + var left, ret, style = elem.style; computed = computed || getStyles( elem ); @@ -84,7 +84,7 @@ if ( window.getComputedStyle ) { ret = style[ name ]; } - // From the awesome hack by Dean Edwards + // Simplified hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number @@ -97,21 +97,13 @@ if ( window.getComputedStyle ) { // Remember the original values left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } } // Support: IE<9 |