]> source.dussan.org Git - jquery.git/commitdiff
merge with master and resolve more conflicts
authorlouisremi <louisremi@louisremi-laptop.(none)>
Tue, 12 Apr 2011 09:29:25 +0000 (11:29 +0200)
committerlouisremi <louisremi@louisremi-laptop.(none)>
Tue, 12 Apr 2011 09:29:25 +0000 (11:29 +0200)
1  2 
src/css.js
src/offset.js
test/unit/core.js
test/unit/css.js
test/unit/effects.js
test/unit/event.js
test/unit/offset.js
test/unit/queue.js
test/unit/traversing.js

diff --cc src/css.js
index dfa820e2297db5d905768ebcf126dcf2ed0fe518,8b0fda000c5fd4f88fa1bacca71ea99f56de894d..964b18fcd700b70ae23dd7399a6d377b06a89f8e
@@@ -245,7 -252,7 +252,11 @@@ if ( !jQuery.support.opacity ) 
  
                        style.filter = ralpha.test(filter) ?
                                filter.replace(ralpha, opacity) :
++<<<<<<< HEAD
 +                              style.filter + " " + opacity;
++=======
+                               filter + " " + opacity;
++>>>>>>> 312df0441b16981dd697d74fcbc1e1f212b47b7e
                }
        };
  }
diff --cc src/offset.js
Simple merge
index bb02a0aa6d1b611901f03f3249eef2199ac26b15,74419fffb6764f02604987e799eec36ff3ae51cf..8d29575a54a91b35416e3d1979246f0ae298ab91
@@@ -845,11 -845,18 +845,18 @@@ test("jQuery.each(Object,Function)", fu
        equals( total, 3, "Looping over an object, with break" );
  
        var f = function(){};
 -      f.foo = 'bar';
 +      f.foo = "bar";
        jQuery.each(f, function(i){
 -              f[i] = 'baz';
 +              f[i] = "baz";
        });
        equals( "baz", f.foo, "Loop over a function" );
+       
+       var stylesheet_count = 0;
+       jQuery.each(document.styleSheets, function(i){
+               stylesheet_count++;
+       });
+       equals(stylesheet_count, 2, "should not throw an error in IE while looping over document.styleSheets and return proper amount");
  });
  
  test("jQuery.makeArray", function(){
index 3996fbccf995460ce70160a64ee6b32020f3e757,ff45762c8683af3a4c5e71ce2ba27bcf348b9925..33bc1548d70bacafd67993142fb8c701a1dab639
@@@ -1,15 -1,15 +1,15 @@@
  module("css", { teardown: moduleTeardown });
  
  test("css(String|Hash)", function() {
-       expect(41);
+       expect( 42 );
  
 -      equals( jQuery('#main').css("display"), 'block', 'Check for css property "display"');
 +      equals( jQuery("#main").css("display"), "block", "Check for css property \"display\"");
  
 -      ok( jQuery('#nothiddendiv').is(':visible'), 'Modifying CSS display: Assert element is visible');
 -      jQuery('#nothiddendiv').css({display: 'none'});
 -      ok( !jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is hidden');
 -      jQuery('#nothiddendiv').css({display: 'block'});
 -      ok( jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is visible');
 +      ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible");
 +      jQuery("#nothiddendiv").css({display: "none"});
 +      ok( !jQuery("#nothiddendiv").is(":visible"), "Modified CSS display: Assert element is hidden");
 +      jQuery("#nothiddendiv").css({display: "block"});
 +      ok( jQuery("#nothiddendiv").is(":visible"), "Modified CSS display: Assert element is visible");
  
        var div = jQuery( "<div>" );
  
        div2.remove();
  
        // handle negative numbers by ignoring #1599, #4216
 -      jQuery('#nothiddendiv').css({ 'width': 1, 'height': 1 });
 +      jQuery("#nothiddendiv").css( {width: 1, height: 1} );
  
 -      var width = parseFloat(jQuery('#nothiddendiv').css('width')), height = parseFloat(jQuery('#nothiddendiv').css('height'));
 -      jQuery('#nothiddendiv').css({ width: -1, height: -1 });
 -      equals( parseFloat(jQuery('#nothiddendiv').css('width')), width, 'Test negative width ignored')
 -      equals( parseFloat(jQuery('#nothiddendiv').css('height')), height, 'Test negative height ignored')
 +      var width = parseFloat(jQuery("#nothiddendiv").css("width")), height = parseFloat(jQuery("#nothiddendiv").css("height"));
 +      jQuery("#nothiddendiv").css({ width: -1, height: -1 });
 +      equals( parseFloat(jQuery("#nothiddendiv").css("width")), width, "Test negative width ignored")
 +      equals( parseFloat(jQuery("#nothiddendiv").css("height")), height, "Test negative height ignored")
  
 -      equals( jQuery('<div style="display: none;">').css('display'), 'none', 'Styles on disconnected nodes');
 +      equals( jQuery("<div style='display: none;'>").css("display"), "none", "Styles on disconnected nodes");
  
 -      jQuery('#floatTest').css({'float': 'right'});
 -      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("#floatTest").css({"float": "right"});
 +      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" );
 +      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" );
        });
 -      jQuery('#foo').css({opacity: ''});
 -      equals( jQuery('#foo').css('opacity'), '1', "Assert opacity is 1 when set to an empty String" );
 +      jQuery("#foo").css({opacity: ""});
 +      equals( jQuery("#foo").css("opacity"), "1", "Assert opacity is 1 when set to an empty String" );
  
 -      equals( jQuery('#empty').css('opacity'), '0', "Assert opacity is accessible via filter property set in stylesheet in IE" );
 -      jQuery('#empty').css({ opacity: '1' });
 -      equals( jQuery('#empty').css('opacity'), '1', "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
 +      equals( jQuery("#empty").css("opacity"), "0", "Assert opacity is accessible via filter property set in stylesheet in IE" );
 +      jQuery("#empty").css({ opacity: "1" });
 +      equals( jQuery("#empty").css("opacity"), "1", "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
+       jQuery.support.opacity ?
+               ok(true, "Requires the same number of tests"):
+               ok( ~jQuery("#empty")[0].currentStyle.filter.indexOf("gradient"), "Assert setting opacity doesn't overwrite other filters of the stylesheet in IE" );
  
 -      var div = jQuery('#nothiddendiv'), child = jQuery('#nothiddendivchild');
 +      var div = jQuery("#nothiddendiv"), child = jQuery("#nothiddendivchild");
  
        equals( parseInt(div.css("fontSize")), 16, "Verify fontSize px set." );
        equals( parseInt(div.css("font-size")), 16, "Verify fontSize px set." );
index 0979a4c1af9e8c69f64a33168921532ab3b0dde1,71a81eef7ca1e54e6b54b860c88578872d4ba631..4faf61743e6f4362b6a10331fcf7ae06a6b64f9d
@@@ -804,10 -804,10 +804,10 @@@ jQuery.checkState = function()
        });
  
        // manually clean data on modified element
 -      jQuery.removeData(this, 'olddisplay', true);
 +      jQuery.removeData(this, "olddisplay", true);
  
        start();
- }
+ };
  
  // Chaining Tests
  test("Chain fadeOut fadeIn", function() {
Simple merge
Simple merge
index 34f61f82681301dcee780a404aad0e7faa1ab2ee,05461cd2615e7920df6d7353030652a56e1334f7..9b612ce37eef59fc09b4695e05cc6fc4d6860a9d
@@@ -1,38 -1,50 +1,50 @@@
  module("queue", { teardown: moduleTeardown });
  
  test("queue() with other types",function() {
-       expect(9);
+       expect(11);
        var counter = 0;
  
-       var $div = jQuery({});
+       stop();
+       var $div = jQuery({}),
+               defer;
 -      $div.promise('foo').done(function() {
++      $div.promise("foo").done(function() {
+               equals( counter, 0, "Deferred for collection with no queue is automatically resolved" );
+       });
  
        $div
 -              .queue('foo',function(){
 +              .queue("foo",function(){
                        equals( ++counter, 1, "Dequeuing" );
 -                      jQuery.dequeue(this,'foo');
 +                      jQuery.dequeue(this,"foo");
                })
 -              .queue('foo',function(){
 +              .queue("foo",function(){
                        equals( ++counter, 2, "Dequeuing" );
 -                      jQuery(this).dequeue('foo');
 +                      jQuery(this).dequeue("foo");
                })
 -              .queue('foo',function(){
 +              .queue("foo",function(){
                        equals( ++counter, 3, "Dequeuing" );
                })
 -              .queue('foo',function(){
 +              .queue("foo",function(){
                        equals( ++counter, 4, "Dequeuing" );
                });
  
 -      defer = $div.promise('foo').done(function() {
++      defer = $div.promise("foo").done(function() {
+               equals(  counter, 4, "Testing previous call to dequeue in deferred"  );
+               start();
+       });
 -      equals( $div.queue('foo').length, 4, "Testing queue length" );
 +      equals( $div.queue("foo").length, 4, "Testing queue length" );
  
 -      $div.dequeue('foo');
 +      $div.dequeue("foo");
  
        equals( counter, 3, "Testing previous call to dequeue" );
 -      equals( $div.queue('foo').length, 1, "Testing queue length" );
 +      equals( $div.queue("foo").length, 1, "Testing queue length" );
  
 -      $div.dequeue('foo');
 +      $div.dequeue("foo");
  
        equals( counter, 4, "Testing previous call to dequeue" );
 -      equals( $div.queue('foo').length, 0, "Testing queue length" );
 +      equals( $div.queue("foo").length, 0, "Testing queue length" );
  });
  
  test("queue(name) passes in the next item in the queue as a parameter", function() {
@@@ -146,3 -169,81 +169,81 @@@ test("clearQueue() clears the fx queue"
  
        div.removeData();
  });
 -});
+ test("_mark() and _unmark()", function() {
+       expect(1);
+       var div = {},
+               $div = jQuery( div );
+       stop();
+       jQuery._mark( div, "foo" );
+       jQuery._mark( div, "foo" );
+       jQuery._unmark( div, "foo" );
+       jQuery._unmark( div, "foo" );
+       $div.promise( "foo" ).done(function() {
+               ok( true, "No more marks" );
+               start();
+       });
+ });
+ test("_mark() and _unmark() default to 'fx'", function() {
+       expect(1);
+       var div = {},
+               $div = jQuery( div );
+       stop();
+       jQuery._mark( div );
+       jQuery._mark( div );
+       jQuery._unmark( div, "fx" );
+       jQuery._unmark( div );
+       $div.promise().done(function() {
+               ok( true, "No more marks" );
+               start();
+       });
+ });
+ test("promise()", function() {
+       expect(1);
+       stop();
+       var objects = [];
+       jQuery.each( [{}, {}], function( i, div ) {
+               var $div = jQuery( div );
+               $div.queue(function( next ) {
+                       setTimeout( function() {
+                               if ( i ) {
+                                       next();
+                                       setTimeout( function() {
+                                               jQuery._unmark( div );
+                                       }, 20 );
+                               } else {
+                                       jQuery._unmark( div );
+                                       setTimeout( function() {
+                                               next();
+                                       }, 20 );
+                               }
+                       }, 50 );
+               }).queue(function( next ) {
+                       next();
+               });
+               jQuery._mark( div );
+               objects.push( $div );
+       });
+       jQuery.when.apply( jQuery, objects ).done(function() {
+               ok( true, "Deferred resolved" );
+               start();
+       });
+       jQuery.each( objects, function() {
+               this.dequeue();
+       });
++});
index 1248e5dd8cca3bfe7abb1ae1f8ee060f24cbc144,140b337aa8ad199a3338c078dce90fdc7f4e9b61..27f31515194e9f8bc1a5e2f0e12b3bbfe6dee27d
@@@ -72,33 -72,32 +72,32 @@@ test("is(String|undefined)", function(
  });
  
  test("is(jQuery)", function() {
-       expect(24);
+       expect(23);
 -      ok( jQuery('#form').is( jQuery('form') ), 'Check for element: A form is a form' );
 -      ok( !jQuery('#form').is( jQuery('div') ), 'Check for element: A form is not a div' );
 -      ok( jQuery('#mark').is( jQuery('.blog') ), 'Check for class: Expected class "blog"' );
 -      ok( !jQuery('#mark').is( jQuery('.link') ), 'Check for class: Did not expect class "link"' );
 -      ok( jQuery('#simon').is( jQuery('.blog.link') ), 'Check for multiple classes: Expected classes "blog" and "link"' );
 -      ok( !jQuery('#simon').is( jQuery('.blogTest') ), 'Check for multiple classes: Expected classes "blog" and "link", but not "blogTest"' );
 -      ok( jQuery('#en').is( jQuery('[lang="en"]') ), 'Check for attribute: Expected attribute lang to be "en"' );
 -      ok( !jQuery('#en').is( jQuery('[lang="de"]') ), 'Check for attribute: Expected attribute lang to be "en", not "de"' );
 -      ok( jQuery('#text1').is( jQuery('[type="text"]') ), 'Check for attribute: Expected attribute type to be "text"' );
 -      ok( !jQuery('#text1').is( jQuery('[type="radio"]') ), 'Check for attribute: Expected attribute type to be "text", not "radio"' );
 -      ok( !jQuery('#text1').is( jQuery(':disabled') ), 'Check for pseudoclass: Expected not disabled' );
 -      ok( jQuery('#radio2').is( jQuery(':checked') ), 'Check for pseudoclass: Expected to be checked' );
 -      ok( !jQuery('#radio1').is( jQuery(':checked') ), 'Check for pseudoclass: Expected not checked' );
 -      ok( jQuery('#foo').is( jQuery(':has(p)') ), 'Check for child: Expected a child "p" element' );
 -      ok( !jQuery('#foo').is( jQuery(':has(ul)') ), 'Check for child: Did not expect "ul" element' );
 -      ok( jQuery('#foo').is( jQuery(':has(p):has(a):has(code)') ), 'Check for childs: Expected "p", "a" and "code" child elements' );
 -      ok( !jQuery('#foo').is( jQuery(':has(p):has(a):has(code):has(ol)') ), 'Check for childs: Expected "p", "a" and "code" child elements, but no "ol"' );
 +      ok( jQuery("#form").is( jQuery("form") ), "Check for element: A form is a form" );
 +      ok( !jQuery("#form").is( jQuery("div") ), "Check for element: A form is not a div" );
 +      ok( jQuery("#mark").is( jQuery(".blog") ), "Check for class: Expected class 'blog'" );
 +      ok( !jQuery("#mark").is( jQuery(".link") ), "Check for class: Did not expect class 'link'" );
 +      ok( jQuery("#simon").is( jQuery(".blog.link") ), "Check for multiple classes: Expected classes 'blog' and 'link'" );
 +      ok( !jQuery("#simon").is( jQuery(".blogTest") ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" );
 +      ok( jQuery("#en").is( jQuery("[lang=\"en\"]") ), "Check for attribute: Expected attribute lang to be 'en'" );
 +      ok( !jQuery("#en").is( jQuery("[lang=\"de\"]") ), "Check for attribute: Expected attribute lang to be 'en', not 'de'" );
 +      ok( jQuery("#text1").is( jQuery("[type=\"text\"]") ), "Check for attribute: Expected attribute type to be 'text'" );
 +      ok( !jQuery("#text1").is( jQuery("[type=\"radio\"]") ), "Check for attribute: Expected attribute type to be 'text', not 'radio'" );
-       ok( jQuery("#text2").is( jQuery(":disabled") ), "Check for pseudoclass: Expected to be disabled" );
 +      ok( !jQuery("#text1").is( jQuery(":disabled") ), "Check for pseudoclass: Expected not disabled" );
 +      ok( jQuery("#radio2").is( jQuery(":checked") ), "Check for pseudoclass: Expected to be checked" );
 +      ok( !jQuery("#radio1").is( jQuery(":checked") ), "Check for pseudoclass: Expected not checked" );
 +      ok( jQuery("#foo").is( jQuery(":has(p)") ), "Check for child: Expected a child 'p' element" );
 +      ok( !jQuery("#foo").is( jQuery(":has(ul)") ), "Check for child: Did not expect 'ul' element" );
 +      ok( jQuery("#foo").is( jQuery(":has(p):has(a):has(code)") ), "Check for childs: Expected 'p', 'a' and 'code' child elements" );
 +      ok( !jQuery("#foo").is( jQuery(":has(p):has(a):has(code):has(ol)") ), "Check for childs: Expected 'p', 'a' and 'code' child elements, but no 'ol'" );
        
        // Some raw elements
 -      ok( jQuery('#form').is( jQuery('form')[0] ), 'Check for element: A form is a form' );
 -      ok( !jQuery('#form').is( jQuery('div')[0] ), 'Check for element: A form is not a div' );
 -      ok( jQuery('#mark').is( jQuery('.blog')[0] ), 'Check for class: Expected class "blog"' );
 -      ok( !jQuery('#mark').is( jQuery('.link')[0] ), 'Check for class: Did not expect class "link"' );
 -      ok( jQuery('#simon').is( jQuery('.blog.link')[0] ), 'Check for multiple classes: Expected classes "blog" and "link"' );
 -      ok( !jQuery('#simon').is( jQuery('.blogTest')[0] ), 'Check for multiple classes: Expected classes "blog" and "link", but not "blogTest"' );
 +      ok( jQuery("#form").is( jQuery("form")[0] ), "Check for element: A form is a form" );
 +      ok( !jQuery("#form").is( jQuery("div")[0] ), "Check for element: A form is not a div" );
 +      ok( jQuery("#mark").is( jQuery(".blog")[0] ), "Check for class: Expected class 'blog'" );
 +      ok( !jQuery("#mark").is( jQuery(".link")[0] ), "Check for class: Did not expect class 'link'" );
 +      ok( jQuery("#simon").is( jQuery(".blog.link")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link'" );
 +      ok( !jQuery("#simon").is( jQuery(".blogTest")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" );
  });
  
  test("index()", function() {