Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jquery/jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Apr 22, 2011
2 parents 2942be7 + 3d9445e commit bc7bb0d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion test/unit/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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();
});

0 comments on commit bc7bb0d

Please sign in to comment.