Remove reverse in traversing for comma selectors. Sizzle's handling of commas is now more consistent.
-Subproject commit 2ae520aa9b7fdc18798df25948191dae69e33ace
+Subproject commit e89d06c4134ec439e52382acd0e569e97fed7ebc
var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
POS = jQuery.expr.match.globalPOS,
// methods guaranteed to produce a unique set when starting from a unique set
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
div = jQuery("<div>");
div.show().appendTo("#qunit-fixture");
ok( !!div.get( 0 ).style.display, "Make sure not hidden div has a inline style." );
+ div.remove();
div = jQuery( document.createElement("div") );
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a pre-created element has default display." );
+ div.remove();
div = jQuery("<div style='display: inline'/>");
div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "inline", "Make sure that element has same display when it was created." );
+ div.remove();
});
test("toggle()", function() {
equal( elem.css("display"), expected, "Show using correct display type for " + selector );
});
+ jQuery("#show-tests").remove();
+
// Make sure that showing or hiding a text node doesn't cause an error
jQuery("<div>test</div> text <span>test</span>").show().remove();
jQuery("<div>test</div> text <span>test</span>").hide().remove();
}
});
});
+
+ jQuery("#show-tests").remove();
});
equal(o, "visible", "Overflow should be visible: " + o);
equal(jQuery.css( this, "display" ), "inline", "Display shouldn't be tampered with.");
+ jQuery(this).remove();
start();
};
-11000,
"support negative values < -10000 (bug #7193)"
);
+
+ jQuery( div ).remove();
});
test("JS Overflow and Display", function() {
// clean up for next test
foo.css({
- marginLeft: '',
- marginRight: '',
- marginTop: '',
- marginBottom: ''
+ marginLeft: "",
+ marginRight: "",
+ marginTop: "",
+ marginBottom: ""
});
start();
});
$div.css("fill-opacity", 0).animate({ "fill-opacity": 1.0 }, 0, function () {
equal( jQuery(this).css("fill-opacity"), 1, "Do not append px to 'fill-opacity'");
+ $div.remove();
});
});
strictEqual( elems.get( 1 ).style.display, "none", "hide( 0 ) called on element within hidden parent should set display to none" );
strictEqual( elems.get( 2 ).style.display, "none", "hide( 1 ) called on element within hidden parent should set display to none" );
+ elems.remove();
start();
});
});
var ratio = computed[ 0 ] / actual;
ok( ratio > 0.9 && ratio < 1.1 , "Starting width was close enough" );
next();
+ parent.remove();
start();
});
});
expect(1);
var markup = jQuery(
- '<div><div><p><span><b class="a">b</b></span></p></div></div>'
+ "<div><div><p><span><b class=\"a\">b</b></span></p></div></div>"
),
path = "";
test("jQuery.Event.currentTarget", function(){
expect(2);
- jQuery('<div><p><button>shiny</button></p></div>')
+ jQuery("<div><p><button>shiny</button></p></div>")
.on( "click", "p", function( e ){
equal( e.currentTarget, this, "Check delegated currentTarget on event" );
})
test("stopPropagation() stops directly-bound events on delegated target", function() {
expect(1);
- var markup = jQuery( '<div><p><a href="#">target</a></p></div>' );
+ var markup = jQuery("<div><p><a href=\"#\">target</a></p></div>");
markup
.on( "click", function() {
ok( false, "directly-bound event on delegate target was called" );
test("inline handler returning false stops default", function() {
expect(1);
- var markup = jQuery('<div><a href="#" onclick="return false">x</a></div>');
+ var markup = jQuery("<div><a href=\"#\" onclick=\"return false\">x</a></div>");
markup.click(function(e) {
ok( e.isDefaultPrevented(), "inline handler prevented default");
return false;
expect(9);
var counter, mixfn;
- jQuery( '<div id="onandoff"><p>on<b>and</b>off</p><div>worked<em>or</em>borked?</div></div>' ).appendTo( 'body' );
+ var $onandoff = jQuery("<div id=\"onandoff\"><p>on<b>and</b>off</p><div>worked<em>or</em>borked?</div></div>").appendTo("body");
// Simple case
jQuery( "#onandoff" )
var data = jQuery.data[ jQuery( "#onandoff" )[0].expando ] || {};
equal( data.events, undefined, "no events left" );
- jQuery("#onandoff").remove();
+ $onandoff.remove();
});
test("special bind/delegate name mapping", function() {
ok( true, "event " + event.type + " triggered" );
};
- jQuery( '<div><button id="mammy">Are We Not Men?</button></div>' )
+ jQuery("<div><button id=\"mammy\">Are We Not Men?</button></div>")
.on( "slap", "button", jQuery.noop )
.on( "swing", "button", comeback )
.find( "button" )
var $newLineTest = jQuery("<div>test<br/>testy</div>").appendTo("#moretests");
$newLineTest.find("br").replaceWith("\n");
equal( $newLineTest.text(), "test\ntesty", "text() does not remove new lines (#11153)" );
+
+ $newLineTest.remove();
});
test("text(undefined)", function() {