mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
CSS: Make .css("width") & .css("height") return fractional values
Fixes gh-1724 Closes gh-2454 Refs gh-2439
This commit is contained in:
@@ -4,8 +4,8 @@ define([
|
||||
], function( jQuery, support ) {
|
||||
|
||||
(function() {
|
||||
var div, container, style, a, pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal,
|
||||
reliableHiddenOffsetsVal, reliableMarginRightVal;
|
||||
var div, container, style, a, pixelPositionVal, boxSizingReliableVal, gBCRDimensionsVal,
|
||||
pixelMarginRightVal, reliableHiddenOffsetsVal, reliableMarginRightVal;
|
||||
|
||||
// Setup
|
||||
div = document.createElement( "div" );
|
||||
@@ -55,6 +55,13 @@ define([
|
||||
return boxSizingReliableVal;
|
||||
},
|
||||
|
||||
gBCRDimensions: function() {
|
||||
if ( pixelPositionVal == null ) {
|
||||
computeStyleTests();
|
||||
}
|
||||
return gBCRDimensionsVal;
|
||||
},
|
||||
|
||||
pixelMarginRight: function() {
|
||||
// Support: Android 4.0-4.3
|
||||
if ( pixelPositionVal == null ) {
|
||||
@@ -105,6 +112,10 @@ define([
|
||||
pixelPositionVal = boxSizingReliableVal = false;
|
||||
pixelMarginRightVal = reliableMarginRightVal = true;
|
||||
|
||||
// Support: IE<9
|
||||
// In IE8 gBCR doesn't report width & height.
|
||||
gBCRDimensionsVal = !!div.getBoundingClientRect().width;
|
||||
|
||||
// Check for getComputedStyle so that this code is not run in IE<9.
|
||||
if ( window.getComputedStyle ) {
|
||||
divStyle = window.getComputedStyle( div );
|
||||
|
||||
Reference in New Issue
Block a user