});
// IE submit delegation
-if ( !support.submitBubbles ) {
+if ( !support.submit ) {
jQuery.event.special.submit = {
setup: function() {
elem.form :
undefined;
- if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+ if ( form && !jQuery._data( form, "submit" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submitBubble = true;
});
- jQuery._data( form, "submitBubbles", true );
+ jQuery._data( form, "submit", true );
}
});
// return undefined since we don't need an event listener
}
// IE change delegation and checkbox/radio fix
-if ( !support.changeBubbles ) {
+if ( !support.change ) {
jQuery.event.special.change = {
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
- jQuery._data( elem, "changeBubbles", true );
+ jQuery._data( elem, "change", true );
}
});
},
};
}
-// Create "bubbling" focus and blur events
-if ( !support.focusinBubbles ) {
+// Support: Firefox
+// Firefox doesn't have focus(in | out) events
+// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+//
+// Support: Chrome, Safari
+// focus(in | out) events fire after focus & blur events,
+// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
+// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
+if ( !support.focusin ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler on the document while someone wants focusin/focusout
var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
jQuery.event.special[ fix ] = {
setup: function() {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": false,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": false,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": true,
+ "focusin": true,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /msie 9\.0/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": false,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": false,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": true,
+ "focusin": true,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /msie 8\.0/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": false,
"boxSizingReliable": false,
- "changeBubbles": false,
+ "change": false,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": false,
"cssFloat": false,
"deleteExpando": false,
- "focusinBubbles": true,
+ "focusin": true,
"html5Clone": false,
"htmlSerialize": false,
"input": false,
"reliableHiddenOffsets": false,
"reliableMarginRight": true,
"style": false,
- "submitBubbles": false
+ "submit": false
};
} else if ( /8.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": false,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /(6|7)\.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /firefox/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /iphone os 8/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": false,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": true,
"clearCloneStyle": true,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": false,
"checkOn": false,
"clearCloneStyle": true,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": true,
"style": true,
- "submitBubbles": true
+ "submit": true
};
} else if ( /android 2\.3/i.test( userAgent ) ) {
expected = {
"ajax": true,
"attributes": true,
"boxSizingReliable": true,
- "changeBubbles": true,
+ "change": true,
"checkClone": true,
"checkOn": false,
"clearCloneStyle": false,
"createHTMLDocument": true,
"cssFloat": true,
"deleteExpando": true,
- "focusinBubbles": false,
+ "focusin": false,
"html5Clone": true,
"htmlSerialize": true,
"input": true,
"reliableHiddenOffsets": true,
"reliableMarginRight": false,
"style": true,
- "submitBubbles": true
+ "submit": true
};
}