Fix #14422 and add more thorough check for CSP violations

Close gh-1413
This commit is contained in:
Oleg
2013-10-30 16:20:38 +04:00
parent ba2a8fb01e
commit 9e3d0f3109
6 changed files with 35 additions and 27 deletions

View File

@@ -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.