aboutsummaryrefslogtreecommitdiffstats
path: root/src/css
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2015-07-02 01:20:18 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-07-07 18:14:04 +0200
commit23212b34e690e857cbc46951dd8c018d181206cb (patch)
treeee3ec4596530373b25e380bd05318df1ba2e6d28 /src/css
parent203979d15391877c1d8ca2674e89dd16cba95029 (diff)
downloadjquery-23212b34e690e857cbc46951dd8c018d181206cb.tar.gz
jquery-23212b34e690e857cbc46951dd8c018d181206cb.zip
CSS: Make .css("width") & .css("height") return fractional values
Fixes gh-1724 Closes gh-2454 Refs gh-2439
Diffstat (limited to 'src/css')
-rw-r--r--src/css/support.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/css/support.js b/src/css/support.js
index 17848d535..854fa6b36 100644
--- a/src/css/support.js
+++ b/src/css/support.js
@@ -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 );