aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.js
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@mit.edu>2012-07-07 17:24:16 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-07 17:28:35 -0400
commitdc83072878ed9636c8158a014bd9fa4acc1ccce3 (patch)
tree9beac865aef03e11b962934bafbf8aa718362152 /src/support.js
parentc8e8d905f8009952e54f53a17f15b3ffcd9b6749 (diff)
downloadjquery-dc83072878ed9636c8158a014bd9fa4acc1ccce3.tar.gz
jquery-dc83072878ed9636c8158a014bd9fa4acc1ccce3.zip
Fix #11249. Inline styles anger Content Security Policy.
Diffstat (limited to 'src/support.js')
-rw-r--r--src/support.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/support.js b/src/support.js
index 9d25c8f29..d9f579053 100644
--- a/src/support.js
+++ b/src/support.js
@@ -15,10 +15,11 @@ jQuery.support = (function() {
// Preliminary tests
div.setAttribute( "className", "t" );
- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.5;'>a</a><input type='checkbox'/>";
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
+ a.style.cssText = "top:1px;float:left;opacity:.5";
// Can't get basic test support
if ( !all || !all.length || !a ) {
@@ -196,8 +197,9 @@ jQuery.support = (function() {
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
- div.innerHTML = "<table><tr><td style='padding:0;margin:0;border:0;display:none'></td><td>t</td></tr></table>";
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
@@ -249,7 +251,8 @@ jQuery.support = (function() {
// (IE 6 does this)
div.style.display = "block";
div.style.overflow = "visible";
- div.innerHTML = "<div style='width:5px;'></div>";
+ div.innerHTML = "<div></div>";
+ div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
container.style.zoom = 1;