Commit 6ece8f13 authored by Dave Methvin's avatar Dave Methvin Committed by timmywil

Revert "Fix #6593. Don't trigger `change` event twice when simulating it on...

Revert "Fix #6593. Don't trigger `change` event twice when simulating it on IE." Add inline handler monitor to delegatetest.html so we can see it fail.

This reverts commit e77686495b6e34938575c9c0fe978cb4a0be6f05.
parent 6c618ddb
...@@ -853,20 +853,21 @@ if ( !jQuery.support.changeBubbles ) { ...@@ -853,20 +853,21 @@ if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = { jQuery.event.special.change = {
setup: function( data, namespaces ) { setup: function( data, namespaces ) {
// If this is a real input element, no need to fake change if ( this.type === "file" ) {
if ( rformElems.test( this.nodeName ) ) {
return false; return false;
} }
for ( var type in changeFilters ) { for ( var type in changeFilters ) {
jQuery.event.add( this, type + "._change", changeFilters[ type ] ); jQuery.event.add( this, type + "._change", changeFilters[ type ] );
} }
return rformElems.test( this.nodeName );
}, },
teardown: function( namespaces ) { teardown: function( namespaces ) {
if ( rformElems.test( this.nodeName ) ) {
return false;
}
jQuery.event.remove( this, "._change" ); jQuery.event.remove( this, "._change" );
return rformElems.test( this.nodeName );
} }
}; };
} }
......
...@@ -96,7 +96,7 @@ th, td { ...@@ -96,7 +96,7 @@ th, td {
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
<p>NOTE: Only IE supports beforeactivate/beforedeactivate; buttons do not support change events.</p> <p>NOTE: Only IE supports propertychange, beforeactivate, beforedeactivate; buttons do not support change events.</p>
<h2>Submit Tests</h2> <h2>Submit Tests</h2>
<table> <table>
...@@ -136,21 +136,21 @@ $("#version").text(version); ...@@ -136,21 +136,21 @@ $("#version").text(version);
$("#fileversion").text($.fn.jquery); $("#fileversion").text($.fn.jquery);
// Events we want to track in row-order // Events we want to track in row-order
var events = "bind-change live-change live-beforeactivate live-focusin bind-focus live-keydown live-beforedeactivate live-focusout bind-blur live-click".split(" "), var events = "bind-change live-change on-change bind-propertychange live-beforeactivate live-focusin bind-focus live-keydown live-beforedeactivate live-focusout bind-blur live-click".split(" "),
counter = 0; counter = 0;
blinker = function(event){ blinker = function(event){
if ( !counter ) { if ( !counter ) {
$("#changes tbody td").text(""); $("#changes tbody td").text("");
} }
var $els = event.data, var $el = event.data,
prev = $els.text(); prev = $el.text();
prev = prev? prev +" | " : ""; prev = prev? prev +" | " : "";
return $els return $el
.text(prev + ++counter+" " + (this.value.replace(/^on$/,"") || this.id || this.checked || "")) .text(prev + ++counter+" " + (this.value.replace(/^on$/,"") || this.id || this.checked || ""))
.css("backgroundColor","#0f0") .css("backgroundColor","#0f0")
.delay(1000) .delay(800)
.queue(function(next){ .queue(function(next){
$els.css("backgroundColor","#afa"); $el.css("backgroundColor","#afa");
--counter; --counter;
next(); next();
}); });
...@@ -165,7 +165,11 @@ for ( var i=0; i < events.length; i++ ) { ...@@ -165,7 +165,11 @@ for ( var i=0; i < events.length; i++ ) {
$("#changes thead td").each(function(){ $("#changes thead td").each(function(){
var id = "#"+this.id, var id = "#"+this.id,
$cell = $('<td></td>'); $cell = $('<td></td>');
if ( api == "bind" ) { if ( api == "on" ) {
$(this).find("input, button, select, textarea").each(function(){
this["on"+type] = function(e){ e = $.event.fix(e||event); e.data = $cell; blinker.call(this, e); };
});
} else if ( api == "bind" ) {
$(this).find("input, button, select, textarea").bind(type, $cell, blinker); $(this).find("input, button, select, textarea").bind(type, $cell, blinker);
} else { } else {
$(id+" input,"+id+" button,"+id+" select,"+id+" textarea").live(type, $cell, blinker); $(id+" input,"+id+" button,"+id+" select,"+id+" textarea").live(type, $cell, blinker);
...@@ -174,8 +178,6 @@ for ( var i=0; i < events.length; i++ ) { ...@@ -174,8 +178,6 @@ for ( var i=0; i < events.length; i++ ) {
}); });
$("#changes tbody").append($row); $("#changes tbody").append($row);
} }
// Buttons don't fire change events so show the cell as gray
$("#changes tbody").find("tr:eq(0), tr:eq(1)").find("td:eq(3)").css("background", "#eee");
jQuery.fn.blink = function(){ jQuery.fn.blink = function(){
return this.css("backgroundColor","green").css("border","solid 3px green").delay(700).queue(function(next){ return this.css("backgroundColor","green").css("border","solid 3px green").delay(700).queue(function(next){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment