diff options
author | Oleg <markelog@gmail.com> | 2013-10-30 16:20:38 +0400 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2013-11-07 22:08:50 +0100 |
commit | 9e3d0f3109756ec8b6166ff60f0d495b8f1d6aca (patch) | |
tree | 5ee552a45a5743bcf15216a57f04ae65ee33e97a /src/event | |
parent | ba2a8fb01efc321524a3600ba7623fabd7d12af2 (diff) | |
download | jquery-9e3d0f3109756ec8b6166ff60f0d495b8f1d6aca.tar.gz jquery-9e3d0f3109756ec8b6166ff60f0d495b8f1d6aca.zip |
Fix #14422 and add more thorough check for CSP violations
Close gh-1413
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/support.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/event/support.js b/src/event/support.js index 1912b8430..d2a092250 100644 --- a/src/event/support.js +++ b/src/event/support.js @@ -4,14 +4,17 @@ define([ (function () { var i, eventName, - div = document.createElement("div" ); + div = document.createElement( "div" ); - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); + eventName = "on" + i; - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; + if ( !(support[ i + "Bubbles" ] = eventName in window) ) { + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; + } } // Null elements to avoid leaks in IE. |