Skip to content

Commit

Permalink
fixup! Core: Drop support for IE <11, iOS <10, Android Browser & Phan…
Browse files Browse the repository at this point in the history
…tomJS
  • Loading branch information
mgol committed Apr 17, 2019
1 parent 3f1da55 commit 074a326
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/core/isAttached.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
span.remove();
} );

QUnit[ document.body.attachShadow ? "test" : "skip" ]( "show/hide shadow child nodes", function( assert ) {
QUnit[ document.body.getRootNode ? "test" : "skip" ]( "show/hide shadow child nodes", function( assert ) {
assert.expect( 28 );
jQuery( "<div id='shadowHost'></div>" ).appendTo( "#qunit-fixture" );
var shadowHost = document.querySelector( "#shadowHost" );
Expand Down Expand Up @@ -1023,7 +1023,7 @@ QUnit[ jQuery.find.compile && jQuery.fn.toggle ? "test" : "skip" ]( "detached to
"cascade-hidden element in detached tree" );
} );

QUnit[ jQuery.find.compile && jQuery.fn.toggle && document.body.attachShadow ? "test" : "skip" ]( "shadow toggle()", function( assert ) {
QUnit[ jQuery.find.compile && jQuery.fn.toggle && document.body.getRootNode ? "test" : "skip" ]( "shadow toggle()", function( assert ) {
assert.expect( 4 );
jQuery( "<div id='shadowHost'></div>" ).appendTo( "#qunit-fixture" );
var shadowHost = document.querySelector( "#shadowHost" );
Expand Down
2 changes: 1 addition & 1 deletion test/unit/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ supportjQuery.each( hideOptions, function( type, setup ) {
assert.expectJqData( this, $span, "olddisplay" );
} );

QUnit[ document.body.attachShadow ? "test" : "skip" ](
QUnit[ document.body.getRootNode ? "test" : "skip" ](
"Persist correct display value - " + type + " hidden, shadow child", function( assert ) {
assert.expect( 3 );

Expand Down

0 comments on commit 074a326

Please sign in to comment.