aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-04-20 14:18:15 -0400
committerRick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com>2012-04-20 14:18:15 -0400
commitd3b61de52084353646e1abee7dc7a76c63237b9b (patch)
tree34ff2b0730e6e8ad3914315f6cac3d2a9bd7d613
parentdf2a22ee6149595b212ef7dca73535a853969f7b (diff)
downloadjquery-d3b61de52084353646e1abee7dc7a76c63237b9b.tar.gz
jquery-d3b61de52084353646e1abee7dc7a76c63237b9b.zip
define curCSS without temp vars to save 10 bytes
-rw-r--r--src/css.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/css.js b/src/css.js
index 07abb631d..adfd4fda3 100644
--- a/src/css.js
+++ b/src/css.js
@@ -15,9 +15,7 @@ var ralpha = /alpha\([^)]*\)/i,
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "O", "Webkit", "Moz", "ms" ],
- curCSS,
- getComputedStyle,
- currentStyle;
+ curCSS;
// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
@@ -198,7 +196,7 @@ jQuery.extend({
jQuery.curCSS = jQuery.css;
if ( document.defaultView && document.defaultView.getComputedStyle ) {
- getComputedStyle = function( elem, name ) {
+ curCSS = function( elem, name ) {
var ret, defaultView, computedStyle, width,
style = elem.style;
@@ -225,10 +223,8 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
return ret;
};
-}
-
-if ( document.documentElement.currentStyle ) {
- currentStyle = function( elem, name ) {
+} else if ( document.documentElement.currentStyle ) {
+ curCSS = function( elem, name ) {
var left, rsLeft, uncomputed,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
@@ -268,8 +264,6 @@ if ( document.documentElement.currentStyle ) {
};
}
-curCSS = getComputedStyle || currentStyle;
-
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value