aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2014-03-03 20:55:30 -0500
committerDave Methvin <dave.methvin@gmail.com>2014-03-04 20:58:31 -0500
commitf4b37d89820535d6c7503925aa8872645681a865 (patch)
tree5535f7c803c2fa51b83c8d4326d92459377d9ec3
parent06adf7c95d93507908181995a9ea15fe2729595a (diff)
downloadjquery-f4b37d89820535d6c7503925aa8872645681a865.tar.gz
jquery-f4b37d89820535d6c7503925aa8872645681a865.zip
CSS: Return values should be numbers
Fixes #14792
-rw-r--r--src/css.js4
-rw-r--r--test/unit/css.js3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/css.js b/src/css.js
index 30342a230..4d6838a4e 100644
--- a/src/css.js
+++ b/src/css.js
@@ -29,8 +29,8 @@ var
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
- letterSpacing: 0,
- fontWeight: 400
+ letterSpacing: "0",
+ fontWeight: "400"
},
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
diff --git a/test/unit/css.js b/test/unit/css.js
index 67bd332a4..09839f185 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -813,12 +813,13 @@ testIframeWithCallback( "css('width') should work correctly before document read
);
test("certain css values of 'normal' should be convertable to a number, see #8627", function() {
- expect ( 2 );
+ expect ( 3 );
var el = jQuery("<div style='letter-spacing:normal;font-weight:normal;'>test</div>").appendTo("#qunit-fixture");
ok( jQuery.isNumeric( parseFloat( el.css("letterSpacing") ) ), "css('letterSpacing') not convertable to number, see #8627" );
ok( jQuery.isNumeric( parseFloat( el.css("fontWeight") ) ), "css('fontWeight') not convertable to number, see #8627" );
+ equal( typeof el.css( "fontWeight" ), "string", ".css() returns a string" );
});
// only run this test in IE9