aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2013-08-08 01:10:35 +0400
committerOleg <markelog@gmail.com>2013-08-10 07:11:24 +0400
commitae630c40ba70b2e3e8f1652c98e641e88c3eb2b6 (patch)
treed7401f779ea2611ae0a11c5ad074d1b356a56309 /test
parent34cc46579236ad1c9cbff7afbf4b4e25ae568ece (diff)
downloadjquery-ae630c40ba70b2e3e8f1652c98e641e88c3eb2b6.tar.gz
jquery-ae630c40ba70b2e3e8f1652c98e641e88c3eb2b6.zip
Correct assertion for #14049 ticket. Close gh-1327
Diffstat (limited to 'test')
-rw-r--r--test/unit/css.js33
1 files changed, 28 insertions, 5 deletions
diff --git a/test/unit/css.js b/test/unit/css.js
index 30082155c..756bc1ed5 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -113,8 +113,7 @@ test("css(String|Hash)", function() {
equal( child[0].style.fontSize, old, "Make sure font-size isn't changed on null." );
});
-test("css() explicit and relative values", function() {
- expect( 30 );
+test( "css() explicit and relative values", 29, function() {
var $elem = jQuery("#nothiddendiv");
$elem.css({ "width": 1, "height": 1, "paddingLeft": "1px", "opacity": 1 });
@@ -199,9 +198,6 @@ test("css() explicit and relative values", function() {
$elem.css( "opacity", "+=0.5" );
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
-
- $elem.css( "order", 2 );
- equal( $elem.css("order"), "2", "2 on order" );
});
test("css(String, Object)", function() {
@@ -1053,4 +1049,31 @@ asyncTest( "Make sure initialized display value for disconnected nodes is correc
jQuery._removeData( jQuery("#display")[ 0 ] );
});
+// Support: IE, Firefox < 22, Safari
+// We have to jump through the hoops here in order to test work with "order" CSS property,
+// that some browsers do not support, this test is not, strictly speaking, correct,
+// but it's the best that we can do.
+(function() {
+ var style = document.createElement( "div" ).style,
+ prefixes = [ "Webkit", "O", "Moz", "ms" ],
+ exist = "order" in style,
+ i = 0;
+
+ if ( !exist ) {
+ for ( ; i < prefixes.length; i++ ) {
+ if ( exist = prefixes[ i ] + "Order" in style ) {
+ break;
+ }
+ }
+ }
+
+ if ( exist ) {
+ test( "Don't append px to CSS \"order\" value (#14049)", 1, function() {
+ var $elem = jQuery( "<div/>" );
+
+ $elem.css( "order", 2 );
+ equal( $elem.css( "order" ), "2", "2 on order" );
+ });
+ }
+})();
}