diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-12-22 17:27:38 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-12-22 17:27:38 +0300 |
commit | 7c0982029f6a013e038fc1a49a483c6f8a24c460 (patch) | |
tree | 9d397aaf1a8c356a05b67ab8314747dd8d7ed705 /src | |
parent | e0d8fc9232c3ade0059590cba3be020649b90f1b (diff) | |
download | jquery-7c0982029f6a013e038fc1a49a483c6f8a24c460.tar.gz jquery-7c0982029f6a013e038fc1a49a483c6f8a24c460.zip |
Revert "CSS: simplify hack of css getter for the computed values"
This reverts commit dac716ca65a83bab2449ffa35c43b4b52e26a0c1.
Diffstat (limited to 'src')
-rw-r--r-- | src/css/curCSS.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 8acf49038..078cff6e1 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -76,7 +76,7 @@ if ( window.getComputedStyle ) { }; curCSS = function( elem, name, computed ) { - var left, ret, + var left, rs, rsLeft, ret, style = elem.style; computed = computed || getStyles( elem ); @@ -88,7 +88,7 @@ if ( window.getComputedStyle ) { ret = style[ name ]; } - // Simplified hack by Dean Edwards + // From the awesome 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 @@ -101,13 +101,21 @@ 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 |