|
14 | 14 | curCSS = require( "./css/curCSS" ), |
15 | 15 | support = require( "./css/support" ), |
16 | 16 | defaultDisplay = require( "./css/defaultDisplay" ), |
| 17 | + addGetHookIf = require( "./css/addGetHookIf" ), |
17 | 18 | data_priv = require( "./data/var/data_priv" ), |
18 | 19 |
|
19 | 20 | // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" |
@@ -369,28 +370,16 @@ jQuery.each([ "height", "width" ], function( i, name ) { |
369 | 370 | }); |
370 | 371 |
|
371 | 372 | // Support: Android 2.3 |
372 | | -jQuery.cssHooks.marginRight = { |
373 | | - get: function( elem, computed ) { |
374 | | - if ( support.reliableMarginRight() ) { |
375 | | - // Hook not needed, remove it. |
376 | | - // Since there are no other hooks for marginRight, remove the whole object. |
377 | | - delete jQuery.cssHooks.marginRight; |
378 | | - return; |
| 373 | +addGetHookIf( jQuery.cssHooks.marginRight, support.reliableMarginRight, |
| 374 | + function ( elem, computed ) { |
| 375 | + if ( computed ) { |
| 376 | + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
| 377 | + // Work around by temporarily setting element display to inline-block |
| 378 | + return jQuery.swap( elem, { "display": "inline-block" }, |
| 379 | + curCSS, [ elem, "marginRight" ] ); |
379 | 380 | } |
380 | | - |
381 | | - jQuery.cssHooks.marginRight.get = function( elem, computed ) { |
382 | | - if ( computed ) { |
383 | | - // Support: Android 2.3 |
384 | | - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
385 | | - // Work around by temporarily setting element display to inline-block |
386 | | - return jQuery.swap( elem, { "display": "inline-block" }, |
387 | | - curCSS, [ elem, "marginRight" ] ); |
388 | | - } |
389 | | - }; |
390 | | - |
391 | | - return jQuery.cssHooks.marginRight.get( elem, computed ); |
392 | 381 | } |
393 | | -}; |
| 382 | +); |
394 | 383 |
|
395 | 384 | // These hooks are used by animate to expand properties |
396 | 385 | jQuery.each({ |
|
0 commit comments