diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2014-02-13 14:51:57 -0800 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2014-02-13 14:57:20 -0800 |
commit | 81b89fd227be2a59db0579ffc93ddbbc19d14dc9 (patch) | |
tree | 323b50744b6f75d64ab8f8c7ef3de804ac550d05 | |
parent | a0b19f7715c30db0b7a68cb2bd0f9b88a0306114 (diff) | |
download | jquery-81b89fd227be2a59db0579ffc93ddbbc19d14dc9.tar.gz jquery-81b89fd227be2a59db0579ffc93ddbbc19d14dc9.zip |
Support: Skip style-based tests when element.style is undefined
Fixes #14785
Ref #13754
Ref badcd1b6f301e6253405f17759c1270549a34e12
-rw-r--r-- | src/css/support.js | 12 | ||||
-rw-r--r-- | src/effects/support.js | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/css/support.js b/src/css/support.js index da9ee34f1..2b525ebf6 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -17,12 +17,16 @@ define([ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; + // Finish early in limited (non-browser) environments + if ( !a || !a.style ) { + return; + } + a.style.cssText = "float:left;opacity:.5"; - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); + // Support: IE<9 + // Make sure that element opacity exists (as opposed to filter) + support.opacity = a.style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) diff --git a/src/effects/support.js b/src/effects/support.js index 85b77c9cc..1faf1110f 100644 --- a/src/effects/support.js +++ b/src/effects/support.js @@ -15,12 +15,16 @@ define([ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; + // Finish early in limited (non-browser) environments + if ( !a || !a.style ) { + return; + } + a.style.cssText = "float:left;opacity:.5"; - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); + // Support: IE<9 + // Make sure that element opacity exists (as opposed to filter) + support.opacity = a.style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) |