diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-04-29 19:54:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 19:54:12 +0200 |
commit | 7dddb19ca4bca9685adb734c76dcf72c3f610007 (patch) | |
tree | 4aaf9854dc5f2d13ad4335031fec13c9117994ef /src/core | |
parent | 6c1e7dbf7311ae7c0c31ba335fe216185047ae5f (diff) | |
download | jquery-7dddb19ca4bca9685adb734c76dcf72c3f610007.tar.gz jquery-7dddb19ca4bca9685adb734c76dcf72c3f610007.zip |
Core: Make isAttached work with iOS 10.0-10.2
The test for Shadow DOM v1 support has been changed to rely on the presence of
`documentElement.getRootNode` as iOS 10.0-10.2 supports `attachShadow` but
doesn't support `getRootNode`.
No new test is necessary - iOS 10.0 fails lots of our test suite because of
this bug.
Fixes gh-4356
Closes gh-4360
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/isAttached.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/isAttached.js b/src/core/isAttached.js index efa2465a9..bd525194a 100644 --- a/src/core/isAttached.js +++ b/src/core/isAttached.js @@ -10,8 +10,12 @@ define( [ }, composed = { composed: true }; + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only // Check attachment across shadow DOM boundaries when possible (gh-3504) - if ( documentElement.attachShadow ) { + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ) || elem.getRootNode( composed ) === elem.ownerDocument; |