No ticket. Optimize the marginRight hook: run the support test once only.

parent 73e12011
...@@ -458,6 +458,8 @@ jQuery.cssHooks.marginRight = { ...@@ -458,6 +458,8 @@ jQuery.cssHooks.marginRight = {
delete jQuery.cssHooks.marginRight; delete jQuery.cssHooks.marginRight;
return; return;
} }
jQuery.cssHooks.marginRight.get = function( elem, computed ) {
if ( computed ) { if ( computed ) {
// Support: Android 2.3 // Support: Android 2.3
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
...@@ -465,6 +467,9 @@ jQuery.cssHooks.marginRight = { ...@@ -465,6 +467,9 @@ jQuery.cssHooks.marginRight = {
return jQuery.swap( elem, { "display": "inline-block" }, return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] ); curCSS, [ elem, "marginRight" ] );
} }
};
return jQuery.cssHooks.marginRight.get( elem, computed );
} }
}; };
...@@ -480,6 +485,7 @@ jQuery.each( [ "top", "left" ], function( i, prop ) { ...@@ -480,6 +485,7 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
delete jQuery.cssHooks[ prop ]; delete jQuery.cssHooks[ prop ];
return; return;
} }
jQuery.cssHooks[ prop ].get = function ( i, prop ) { jQuery.cssHooks[ prop ].get = function ( i, prop ) {
if ( computed ) { if ( computed ) {
computed = curCSS( elem, prop ); computed = curCSS( elem, prop );
...@@ -489,6 +495,7 @@ jQuery.each( [ "top", "left" ], function( i, prop ) { ...@@ -489,6 +495,7 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
computed; computed;
} }
}; };
return jQuery.cssHooks[ prop ].get( i, prop ); return jQuery.cssHooks[ prop ].get( i, prop );
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment