diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-04-22 00:28:11 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-22 00:28:11 -0400 |
commit | bc7bb0df28f52846e54a2ce5ecf493d4594b2a90 (patch) | |
tree | ec47862360fc160e4d3c2366095005cad5ed629d | |
parent | 2942be780f3f243dbf82ca012bba284846afee13 (diff) | |
parent | 3d9445e3fce84448b4b569a1a6f1aa454a898265 (diff) | |
download | jquery-bc7bb0df28f52846e54a2ce5ecf493d4594b2a90.tar.gz jquery-bc7bb0df28f52846e54a2ce5ecf493d4594b2a90.zip |
Merge branch 'master' of github.com:jquery/jquery
-rw-r--r-- | src/css.js | 4 | ||||
-rw-r--r-- | test/unit/css.js | 26 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/css.js b/src/css.js index c5c01ecac..318cd5979 100644 --- a/src/css.js +++ b/src/css.js @@ -59,7 +59,9 @@ jQuery.extend({ "fontWeight": true, "opacity": true, "zoom": true, - "lineHeight": true + "lineHeight": true, + "widows": true, + "orphans": true }, // Add in properties whose names you wish to fix before diff --git a/test/unit/css.js b/test/unit/css.js index 60e8744c1..a34f54a06 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -45,9 +45,9 @@ test("css(String|Hash)", function() { equals( jQuery("#floatTest").css("float"), "right", "Modified CSS float using \"float\": Assert float is right"); jQuery("#floatTest").css({"font-size": "30px"}); equals( jQuery("#floatTest").css("font-size"), "30px", "Modified CSS font-size: Assert font-size is 30px"); - jQuery.each("0,0.25,0.5,0.75,1".split(","), function(i, n) { jQuery("#foo").css({opacity: n}); + equals( jQuery("#foo").css("opacity"), parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a String" ); jQuery("#foo").css({opacity: parseFloat(n)}); equals( jQuery("#foo").css("opacity"), parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a Number" ); @@ -394,3 +394,27 @@ test("jQuery.cssProps behavior, (bug #8402)", function() { // cleanup jQuery.cssProps jQuery.cssProps.top = undefined; }); + +test("widows & orphans #8936", function () { + expect(4); + + var $p = jQuery("<p>").appendTo("#main").end(); + + $p.css({ + widows: 0, + orphans: 0 + }); + + equal( $p.css("widows"), 0, "widows correctly start with value 0"); + equal( $p.css("orphans"), 0, "orphans correctly start with value 0"); + + $p.css({ + widows: 3, + orphans: 3 + }); + + equal( $p.css("widows"), 3, "widows correctly set to 3"); + equal( $p.css("orphans"), 3, "orphans correctly set to 3"); + + $p.remove(); +}); |