This is an experiment to reproduce a possible bug, where synthetic click events for jQuery Event Delegates for checkboxes are broken in WebKit based browsers.
Older versions of jQuery (1.7.2) does not exhibit this behaviour, but the latest stable (and development) of the 1.9.x branch does.
In most browsers, the results table below will display "YES" for every scenario. In WebKit browsers, it seems that the synthetic trigger of the click event never activates the event delegate.
Please view the source of this document to see the test setup.
These few lines from jQuery seem to be the cause of the unexpected behaviour, although I can't quite figure out why
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
this.click();
return false;
}
}
},
Click | Delegated click | |
---|---|---|
Click for attached nodes | Nope | Nope |
Click for un-attached nodes | Nope | Nope |