From 4cbb1a0063d06ddece8982b868298e90aefa2d08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Sun, 26 Jan 2014 02:07:35 +0100 Subject: [PATCH] =?utf8?q?Css:=20Don=E2=80=99t=20cache=20support.reliableM?= =?utf8?q?arginRight;=20thanks=20@jdalton,=20@timmywil?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes #14731 --- src/css/support.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/css/support.js b/src/css/support.js index d5ea92820..a3af1a204 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -5,7 +5,7 @@ define([ (function() { var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal, - pixelPositionVal, reliableMarginRightVal, + pixelPositionVal, div = document.createElement( "div" ), containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px", divReset = @@ -107,10 +107,10 @@ define([ }, reliableMarginRight: function() { - var body, container, div, marginDiv; + var body, container, div, marginDiv, reliableMarginRightVal; // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( reliableMarginRightVal == null && window.getComputedStyle ) { + if ( window.getComputedStyle ) { body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body ) { // Test fired too early or in an unsupported environment, exit. @@ -136,9 +136,9 @@ define([ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); body.removeChild( container ); - } - return reliableMarginRightVal; + return reliableMarginRightVal; + } } }); @@ -171,7 +171,6 @@ define([ // Will be changed later if needed. boxSizingReliableVal = true; pixelPositionVal = false; - reliableMarginRightVal = true; // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { -- 2.39.5