Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/jquery/jquery
Browse files Browse the repository at this point in the history
Conflicts:
	src/ajax.js
  • Loading branch information
jaubourg committed Oct 15, 2010
2 parents 8c9a77f + 497fc98 commit f71ef9e
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 64 deletions.
5 changes: 2 additions & 3 deletions test/unit/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ test("css(String, Object)", function() {

// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
j.css("fontSize", "15px");
equals( j.css("fontSize"), "15px", "Check node,textnode,comment css works" );

j.css("overflow", "visible");
equals( j.css("overflow"), "visible", "Check node,textnode,comment css works" );
// opera sometimes doesn't update 'display' correctly, see #2037
jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML
equals( jQuery("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" );
Expand Down
63 changes: 46 additions & 17 deletions test/unit/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,56 @@ test("animate negative height", function() {

test("animate block as inline width/height", function() {
expect(3);
stop();
jQuery("#foo").css({ display: "inline", width: '', height: '' }).animate({ width: 42, height: 42 }, 100, function() {
equals( jQuery(this).css("display"), jQuery.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
equals( this.offsetWidth, 42, "width was animated" );
equals( this.offsetHeight, 42, "height was animated" );
start();
});

var span = jQuery("<span>").css("display", "inline-block").appendTo("body"),
expected = span.css("display");

span.remove();

if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
stop();

jQuery("#foo").css({ display: "inline", width: '', height: '' }).animate({ width: 42, height: 42 }, 100, function() {
equals( jQuery(this).css("display"), jQuery.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
equals( this.offsetWidth, 42, "width was animated" );
equals( this.offsetHeight, 42, "height was animated" );
start();
});

// Browser doesn't support inline-block
} else {
ok( true, "Browser doesn't support inline-block" );
ok( true, "Browser doesn't support inline-block" );
ok( true, "Browser doesn't support inline-block" );
}
});

test("animate native inline width/height", function() {
expect(3);
stop();
jQuery("#foo").css({ display: "", width: '', height: '' })
.append('<span>text</span>')
.children('span')
.animate({ width: 42, height: 42 }, 100, function() {
equals( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
equals( this.offsetWidth, 42, "width was animated" );
equals( this.offsetHeight, 42, "height was animated" );
start();
});

var span = jQuery("<span>").css("display", "inline-block").appendTo("body"),
expected = span.css("display");

span.remove();

if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
stop();
jQuery("#foo").css({ display: "", width: '', height: '' })
.append('<span>text</span>')
.children('span')
.animate({ width: 42, height: 42 }, 100, function() {
equals( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
equals( this.offsetWidth, 42, "width was animated" );
equals( this.offsetHeight, 42, "height was animated" );
start();
});

// Browser doesn't support inline-block
} else {
ok( true, "Browser doesn't support inline-block" );
ok( true, "Browser doesn't support inline-block" );
ok( true, "Browser doesn't support inline-block" );
}
});

test("animate block width/height", function() {
Expand Down
62 changes: 21 additions & 41 deletions test/unit/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,8 @@ test("live with namespaces", function(){
});

test("live with change", function(){
expect(8);

var selectChange = 0, checkboxChange = 0;

var select = jQuery("select[name='S1']")
Expand Down Expand Up @@ -1269,28 +1271,13 @@ test("live with change", function(){
checkbox.trigger("change");
equals( checkboxChange, 1, "Change on checkbox." );

// test before activate on radio

// test blur/focus on textarea
var textarea = jQuery("#area1"), textareaChange = 0, oldVal = textarea.val();
textarea.live("change", function() {
textareaChange++;
});

textarea.val(oldVal + "foo");
textarea.trigger("change");
equals( textareaChange, 1, "Change on textarea." );

textarea.val(oldVal);
textarea.die("change");

// test blur/focus on text
var text = jQuery("#name"), textChange = 0, oldTextVal = text.val();
text.live("change", function() {
textChange++;
});

text.val(oldVal+"foo");
text.val(oldTextVal+"foo");
text.trigger("change");
equals( textChange, 1, "Change on text input." );

Expand Down Expand Up @@ -1707,6 +1694,8 @@ test("delegate with multiple events", function(){
});

test("delegate with change", function(){
expect(8);

var selectChange = 0, checkboxChange = 0;

var select = jQuery("select[name='S1']");
Expand Down Expand Up @@ -1738,28 +1727,13 @@ test("delegate with change", function(){
checkbox.trigger("change");
equals( checkboxChange, 1, "Change on checkbox." );

// test before activate on radio

// test blur/focus on textarea
var textarea = jQuery("#area1"), textareaChange = 0, oldVal = textarea.val();
jQuery("#body").delegate("#area1", "change", function() {
textareaChange++;
});

textarea.val(oldVal + "foo");
textarea.trigger("change");
equals( textareaChange, 1, "Change on textarea." );

textarea.val(oldVal);
jQuery("#body").undelegate("#area1", "change");

// test blur/focus on text
var text = jQuery("#name"), textChange = 0, oldTextVal = text.val();
jQuery("#body").delegate("#name", "change", function() {
textChange++;
});

text.val(oldVal+"foo");
text.val(oldTextVal+"foo");
text.trigger("change");
equals( textChange, 1, "Change on text input." );

Expand Down Expand Up @@ -1843,21 +1817,27 @@ test("window resize", function() {

ok( !jQuery(window).data("__events__"), "Make sure all the events are gone." );
});
test("focusin bubbles", function(){

test("focusin bubbles", function() {
//create an input and focusin on it
var input = jQuery("<input/>"),
order = 0;
input.appendTo(document.body);
jQuery(document.body).bind("focusin.focusinBubblesTest",function(){
var input = jQuery("<input/>"), order = 0;

input.prependTo("body");

jQuery("body").bind("focusin.focusinBubblesTest",function(){
equals(1,order++,"focusin on the body second")
})
});

input.bind("focusin.focusinBubblesTest",function(){
equals(0,order++,"focusin on the element first")
})
});

input[0].focus();
input.remove();
jQuery(document.body).unbind("focusin.focusinBubblesTest");
})

jQuery("body").unbind("focusin.focusinBubblesTest");
});

/*
test("jQuery(function($) {})", function() {
stop();
Expand Down
3 changes: 1 addition & 2 deletions test/unit/selector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module("selector");

test("element", function() {
expect(19);
expect(18);
QUnit.reset();

ok( jQuery("*").size() >= 30, "Select all" );
Expand All @@ -27,7 +27,6 @@ test("element", function() {
ok( jQuery("#lengthtest input").length, '&lt;input name="length"&gt; cannot be found under IE, see #945' );

// Check for unique-ness and sort order
same( jQuery("*, *").get(), jQuery("*").get(), "Check for duplicates: *, *" );
same( jQuery("p, div p").get(), jQuery("p").get(), "Check for duplicates: p, div p" );

t( "Checking sort order", "h2, h1", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.3pre
1.4.4pre

0 comments on commit f71ef9e

Please sign in to comment.