Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,21 @@ jQuery.each({
};
});

// Support: Firefox, Chrome, Safari
// 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&q=focusin&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything after "id=number" should be cut off

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, although i would prefer if you would use optative then imperative mood when you suggesting something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...can be cut off"? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :-), i appreciated it.

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() {
Expand Down
2 changes: 1 addition & 1 deletion src/event/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define([
"../var/support"
], function( support ) {

support.focusinBubbles = "onfocusin" in window;
support.focusin = "onfocusin" in window;

return support;

Expand Down
20 changes: 10 additions & 10 deletions test/unit/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -80,7 +80,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": false,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": true,
"focusin": true,
"noCloneChecked": false,
"optDisabled": true,
"optSelected": false,
Expand All @@ -98,7 +98,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": false,
"cors": false,
"createHTMLDocument": true,
"focusinBubbles": true,
"focusin": true,
"noCloneChecked": false,
"optDisabled": true,
"optSelected": false,
Expand All @@ -116,7 +116,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": false,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -134,7 +134,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -152,7 +152,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -170,7 +170,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": false,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -188,7 +188,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -206,7 +206,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": true,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": true,
"optSelected": true,
Expand All @@ -224,7 +224,7 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
"clearCloneStyle": false,
"cors": true,
"createHTMLDocument": true,
"focusinBubbles": false,
"focusin": false,
"noCloneChecked": true,
"optDisabled": false,
"optSelected": true,
Expand Down