diff options
53 files changed, 243 insertions, 716 deletions
diff --git a/demos/autocomplete/maxheight.html b/demos/autocomplete/maxheight.html index 9ebda7938..b8c59819d 100644 --- a/demos/autocomplete/maxheight.html +++ b/demos/autocomplete/maxheight.html @@ -13,12 +13,6 @@ /* prevent horizontal scrollbar */ overflow-x: hidden; } - /* IE 6 doesn't support max-height - * we use height instead, but this forces the menu to always be this tall - */ - * html .ui-autocomplete { - height: 100px; - } </style> <script src="../../external/requirejs/require.js"></script> <script src="../bootstrap.js"> diff --git a/demos/bootstrap.js b/demos/bootstrap.js index 9b0468028..ba1cde2e9 100644 --- a/demos/bootstrap.js +++ b/demos/bootstrap.js @@ -2,9 +2,7 @@ ( function() { "use strict"; -// Find the script element -var scripts = document.getElementsByTagName( "script" ); -var script = scripts[ scripts.length - 1 ]; +var script = document.currentScript; // Read the modules var modules = script.getAttribute( "data-modules" ); diff --git a/demos/tooltip/custom-style.html b/demos/tooltip/custom-style.html index 5cbd4bbd3..8ab8dcc9d 100644 --- a/demos/tooltip/custom-style.html +++ b/demos/tooltip/custom-style.html @@ -60,8 +60,6 @@ width: 25px; height: 25px; box-shadow: 6px 5px 9px -9px black; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); transform: rotate(45deg); } .arrow.top:after { diff --git a/tests/lib/qunit-assert-domequal.js b/tests/lib/qunit-assert-domequal.js index bcce60702..d99ed06de 100644 --- a/tests/lib/qunit-assert-domequal.js +++ b/tests/lib/qunit-assert-domequal.js @@ -83,17 +83,6 @@ function getElementStyles( elem ) { key = style[ len ]; camelKey = camelCase( key ); - // Support: IE <=11+ - // In IE, `option` elements may have different initial `option` colors. - // They may initially all be transparent, but later the selected - // option gets a blue background with white text; ignore it. - if ( document.documentMode && elem.nodeName.toLowerCase() === "option" && ( - camelKey === "color" || - camelKey.indexOf( "Color" ) === camelKey.length - "Color".length - ) ) { - continue; - } - if ( typeof style[ key ] === "string" ) { styles[ camelKey ] = style[ key ]; } diff --git a/tests/lib/vendor/qunit-composite/qunit-composite.js b/tests/lib/vendor/qunit-composite/qunit-composite.js index 042d024b4..b3c2b749d 100644 --- a/tests/lib/vendor/qunit-composite/qunit-composite.js +++ b/tests/lib/vendor/qunit-composite/qunit-composite.js @@ -35,9 +35,6 @@ function addEvent( elem, type, fn ) { if ( elem.addEventListener ) { // Standards-based browsers elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - // support: IE <9 - elem.attachEvent( "on" + type, fn ); } } diff --git a/tests/unit/autocomplete/events.js b/tests/unit/autocomplete/events.js index d08fe9828..9ee3a92e4 100644 --- a/tests/unit/autocomplete/events.js +++ b/tests/unit/autocomplete/events.js @@ -75,11 +75,7 @@ $.each( [ assert.ok( menu.is( ":visible" ), "menu is visible after delay" ); element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); - - // Blur must be async for IE to handle it properly - setTimeout( function() { - element.simulate( "blur" ); - } ); + element.simulate( "blur" ); } ); } ); } ); diff --git a/tests/unit/button/core.js b/tests/unit/button/core.js index 7b696631e..ae4b870ed 100644 --- a/tests/unit/button/core.js +++ b/tests/unit/button/core.js @@ -2,7 +2,6 @@ define( [ "qunit", "jquery", "lib/helper", - "ui/safe-active-element", "ui/widgets/button" ], function( QUnit, $, helper ) { "use strict"; @@ -17,10 +16,10 @@ QUnit.test( "Disabled button loses focus", function( assert ) { element.trigger( "focus" ); setTimeout( function() { - assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" ); + assert.equal( element[ 0 ], document.activeElement, "Button is focused" ); element.button( "disable" ); - assert.notEqual( element[ 0 ], $.ui.safeActiveElement( document ), "Button has had focus removed" ); + assert.notEqual( element[ 0 ], document.activeElement, "Button has had focus removed" ); ready(); } ); } ); diff --git a/tests/unit/checkboxradio/core.js b/tests/unit/checkboxradio/core.js index ad27f1be0..f218cc1cd 100644 --- a/tests/unit/checkboxradio/core.js +++ b/tests/unit/checkboxradio/core.js @@ -33,7 +33,6 @@ QUnit.test( "Radios - Initial class structure", function( assert ) { } ); QUnit.test( "Ensure checked after single click on checkbox label button", function( assert ) { - var ready = assert.async(); assert.expect( 2 ); $( "#check2" ).checkboxradio().on( "change", function() { @@ -43,14 +42,7 @@ QUnit.test( "Ensure checked after single click on checkbox label button", functi assert.hasClasses( label, "ui-state-active" ); } ); - // Support: Opera - // Opera doesn't trigger a change event when this is done synchronously. - // This seems to be a side effect of another test, but until that can be - // tracked down, this delay will have to do. - setTimeout( function() { - $( "#check2" ).checkboxradio( "widget" ).simulate( "click" ); - ready(); - } ); + $( "#check2" ).checkboxradio( "widget" ).simulate( "click" ); } ); QUnit.test( "Handle form association via form attribute", function( assert ) { diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index d9677a406..5d9eee07c 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -3,7 +3,6 @@ define( [ "jquery", "lib/common", "lib/helper", - "ui/form", "ui/labels", "ui/unique-id" ], function( QUnit, $, common, helper ) { @@ -150,10 +149,6 @@ QUnit.test( "Labels", function( assert ) { function testLabels( testType ) { var labels = dom.find( "#test" ).labels(); var found = labels.map( function() { - - // Support: Core 1.9 Only - // We use String.prototype.trim because core 1.9.x silently fails - // when white space is present return String.prototype.trim.call( $( this ).text() ); } ).get(); @@ -183,7 +178,7 @@ QUnit.test( "Labels", function( assert ) { QUnit.test( name + this.id.replace( /_/g, " " ), function( assert ) { var ready = assert.async(); assert.expect( 1 ); - var form = input._form(); + var form = $( input.prop( "form" ) ); // If input has a form the value should reset to "" if not it should be "changed" var value = form.length ? "" : "changed"; diff --git a/tests/unit/datepicker/core.js b/tests/unit/datepicker/core.js index 74320931e..edc16d005 100644 --- a/tests/unit/datepicker/core.js +++ b/tests/unit/datepicker/core.js @@ -311,9 +311,6 @@ QUnit.test( "customStructure", function( assert ) { } ); } - // TODO: figure out why this setTimeout is needed in IE, - // it only is necessary when the previous baseStructure tests runs first - // Support: IE setTimeout( step1 ); } ); diff --git a/tests/unit/datepicker/options.js b/tests/unit/datepicker/options.js index 5d03cd61f..3055bc199 100644 --- a/tests/unit/datepicker/options.js +++ b/tests/unit/datepicker/options.js @@ -5,8 +5,7 @@ define( [ "ui/widgets/datepicker", "ui/i18n/datepicker-fr", "ui/i18n/datepicker-he", - "ui/i18n/datepicker-zh-CN", - "ui/ie" + "ui/i18n/datepicker-zh-CN" ], function( QUnit, $, testHelper ) { "use strict"; @@ -97,147 +96,131 @@ QUnit.test( "change", function( assert ) { assert.equal( $.datepicker._defaults.showOn, "focus", "Retain default showOn" ); } ); -( function() { - var url = window.location.search; - url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + 9 ) ); +QUnit.test( "invocation", function( assert ) { + var ready = assert.async(); + var button, image, + body = $( "body" ); - // TODO: This test occassionally fails in IE in TestSwarm - if ( $.ui.ie && url && url.indexOf( "http" ) === 0 ) { - return; - } + assert.expect( 29 ); - QUnit.test( "invocation", function( assert ) { - var ready = assert.async(); - var button, image, - isOldIE = $.ui.ie && ( !document.documentMode || document.documentMode < 9 ), - body = $( "body" ); - - assert.expect( isOldIE ? 25 : 29 ); - - function step0() { - var inp = testHelper.initNewInput(), - dp = $( "#ui-datepicker-div" ); - - button = inp.siblings( "button" ); - assert.ok( button.length === 0, "Focus - button absent" ); - image = inp.siblings( "img" ); - assert.ok( image.length === 0, "Focus - image absent" ); - - testHelper.onFocus( inp, function() { - assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" ); - inp.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); - assert.ok( !dp.is( ":visible" ), "Focus - hidden on exit" ); - step1(); - } ); - } + function step0() { + var inp = testHelper.initNewInput(), + dp = $( "#ui-datepicker-div" ); - function step1() { + button = inp.siblings( "button" ); + assert.ok( button.length === 0, "Focus - button absent" ); + image = inp.siblings( "img" ); + assert.ok( image.length === 0, "Focus - image absent" ); - var inp = testHelper.initNewInput(), - dp = $( "#ui-datepicker-div" ); + testHelper.onFocus( inp, function() { + assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" ); + inp.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + assert.ok( !dp.is( ":visible" ), "Focus - hidden on exit" ); + step1(); + } ); + } - testHelper.onFocus( inp, function() { - assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" ); - body.simulate( "mousedown", {} ); - assert.ok( !dp.is( ":visible" ), "Focus - hidden on external click" ); - inp.datepicker( "hide" ).datepicker( "destroy" ); + function step1() { - step2(); - } ); - } + var inp = testHelper.initNewInput(), + dp = $( "#ui-datepicker-div" ); - function step2() { - var inp = testHelper.initNewInput( { - showOn: "button", - buttonText: "Popup" - } ), - dp = $( "#ui-datepicker-div" ); - - assert.ok( !dp.is( ":visible" ), "Button - initially hidden" ); - button = inp.siblings( "button" ); - image = inp.siblings( "img" ); - assert.ok( button.length === 1, "Button - button present" ); - assert.ok( image.length === 0, "Button - image absent" ); - assert.equal( button.text(), "Popup", "Button - button text" ); - - testHelper.onFocus( inp, function() { - assert.ok( !dp.is( ":visible" ), "Button - not rendered on focus" ); - button.trigger( "click" ); - assert.ok( dp.is( ":visible" ), "Button - rendered on button click" ); - button.trigger( "click" ); - assert.ok( !dp.is( ":visible" ), "Button - hidden on second button click" ); - inp.datepicker( "hide" ).datepicker( "destroy" ); - - step3(); - } ); - } + testHelper.onFocus( inp, function() { + assert.ok( dp.is( ":visible" ), "Focus - rendered on focus" ); + body.simulate( "mousedown", {} ); + assert.ok( !dp.is( ":visible" ), "Focus - hidden on external click" ); + inp.datepicker( "hide" ).datepicker( "destroy" ); - function step3() { - var inp = testHelper.initNewInput( { - showOn: "button", - buttonImageOnly: true, - buttonImage: "images/calendar.gif", - buttonText: "Cal" - } ), - dp = $( "#ui-datepicker-div" ); - - assert.ok( !dp.is( ":visible" ), "Image button - initially hidden" ); - button = inp.siblings( "button" ); - assert.ok( button.length === 0, "Image button - button absent" ); - image = inp.siblings( "img" ); - assert.ok( image.length === 1, "Image button - image present" ); - assert.ok( /images\/calendar\.gif$/.test( image.attr( "src" ) ), "Image button - image source" ); - assert.equal( image.attr( "title" ), "Cal", "Image button - image text" ); - - testHelper.onFocus( inp, function() { - assert.ok( !dp.is( ":visible" ), "Image button - not rendered on focus" ); - image.trigger( "click" ); - assert.ok( dp.is( ":visible" ), "Image button - rendered on image click" ); - image.trigger( "click" ); - assert.ok( !dp.is( ":visible" ), "Image button - hidden on second image click" ); - inp.datepicker( "hide" ).datepicker( "destroy" ); - - step4(); - } ); - } + step2(); + } ); + } - function step4() { - var inp = testHelper.initNewInput( { - showOn: "both", - buttonImage: "images/calendar.gif" - } ), - dp = $( "#ui-datepicker-div" ); - - assert.ok( !dp.is( ":visible" ), "Both - initially hidden" ); - button = inp.siblings( "button" ); - assert.ok( button.length === 1, "Both - button present" ); - image = inp.siblings( "img" ); - assert.ok( image.length === 0, "Both - image absent" ); - image = button.children( "img" ); - assert.ok( image.length === 1, "Both - button image present" ); - - // TODO: This test occasionally fails to focus in IE8 in BrowserStack - if ( !isOldIE ) { - testHelper.onFocus( inp, function() { - assert.ok( dp.is( ":visible" ), "Both - rendered on focus" ); - body.simulate( "mousedown", {} ); - assert.ok( !dp.is( ":visible" ), "Both - hidden on external click" ); - button.trigger( "click" ); - assert.ok( dp.is( ":visible" ), "Both - rendered on button click" ); - button.trigger( "click" ); - assert.ok( !dp.is( ":visible" ), "Both - hidden on second button click" ); - inp.datepicker( "hide" ).datepicker( "destroy" ); - - ready(); - } ); - } else { - ready(); - } - } + function step2() { + var inp = testHelper.initNewInput( { + showOn: "button", + buttonText: "Popup" + } ), + dp = $( "#ui-datepicker-div" ); + + assert.ok( !dp.is( ":visible" ), "Button - initially hidden" ); + button = inp.siblings( "button" ); + image = inp.siblings( "img" ); + assert.ok( button.length === 1, "Button - button present" ); + assert.ok( image.length === 0, "Button - image absent" ); + assert.equal( button.text(), "Popup", "Button - button text" ); + + testHelper.onFocus( inp, function() { + assert.ok( !dp.is( ":visible" ), "Button - not rendered on focus" ); + button.trigger( "click" ); + assert.ok( dp.is( ":visible" ), "Button - rendered on button click" ); + button.trigger( "click" ); + assert.ok( !dp.is( ":visible" ), "Button - hidden on second button click" ); + inp.datepicker( "hide" ).datepicker( "destroy" ); + + step3(); + } ); + } - step0(); - } ); -} )(); + function step3() { + var inp = testHelper.initNewInput( { + showOn: "button", + buttonImageOnly: true, + buttonImage: "images/calendar.gif", + buttonText: "Cal" + } ), + dp = $( "#ui-datepicker-div" ); + + assert.ok( !dp.is( ":visible" ), "Image button - initially hidden" ); + button = inp.siblings( "button" ); + assert.ok( button.length === 0, "Image button - button absent" ); + image = inp.siblings( "img" ); + assert.ok( image.length === 1, "Image button - image present" ); + assert.ok( /images\/calendar\.gif$/.test( image.attr( "src" ) ), "Image button - image source" ); + assert.equal( image.attr( "title" ), "Cal", "Image button - image text" ); + + testHelper.onFocus( inp, function() { + assert.ok( !dp.is( ":visible" ), "Image button - not rendered on focus" ); + image.trigger( "click" ); + assert.ok( dp.is( ":visible" ), "Image button - rendered on image click" ); + image.trigger( "click" ); + assert.ok( !dp.is( ":visible" ), "Image button - hidden on second image click" ); + inp.datepicker( "hide" ).datepicker( "destroy" ); + + step4(); + } ); + } + + function step4() { + var inp = testHelper.initNewInput( { + showOn: "both", + buttonImage: "images/calendar.gif" + } ), + dp = $( "#ui-datepicker-div" ); + + assert.ok( !dp.is( ":visible" ), "Both - initially hidden" ); + button = inp.siblings( "button" ); + assert.ok( button.length === 1, "Both - button present" ); + image = inp.siblings( "img" ); + assert.ok( image.length === 0, "Both - image absent" ); + image = button.children( "img" ); + assert.ok( image.length === 1, "Both - button image present" ); + + testHelper.onFocus( inp, function() { + assert.ok( dp.is( ":visible" ), "Both - rendered on focus" ); + body.simulate( "mousedown", {} ); + assert.ok( !dp.is( ":visible" ), "Both - hidden on external click" ); + button.trigger( "click" ); + assert.ok( dp.is( ":visible" ), "Both - rendered on button click" ); + button.trigger( "click" ); + assert.ok( !dp.is( ":visible" ), "Both - hidden on second button click" ); + inp.datepicker( "hide" ).datepicker( "destroy" ); + + ready(); + } ); + } + + step0(); +} ); QUnit.test( "otherMonths", function( assert ) { assert.expect( 8 ); diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index cb0ee53e0..d307504b8 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -103,12 +103,6 @@ QUnit.test( "focus tabbable", function( assert ) { }; function checkFocus( markup, options, testFn, next ) { - - // Support: IE8 - // For some reason the focus doesn't get set properly if we don't - // focus the body first. - $( "body" ).trigger( "focus" ); - element = $( markup ).dialog( options ); setTimeout( function() { testFn( function done() { @@ -122,31 +116,12 @@ QUnit.test( "focus tabbable", function( assert ) { checkFocus( "<div><input><input></div>", options, function( done ) { var input = element.find( "input" ).last().trigger( "focus" ).trigger( "blur" ); - // Support: IE 11+ - // In IE in jQuery 3.4+ a sequence: - // $( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" ) - // doesn't end up with a focused input. See: - // https://github.com/jquery/jquery/issues/4856 - // However, in this test we only want to check that the last focused - // input receives the focus back when `_focusTabbable()` is called - // which in reality doesn't happen so quickly so let's avoid the issue - // by waiting a bit. - if ( document.documentMode ) { - setTimeout( function() { - focusTabbableAndAssert(); - }, 500 ); - } else { - focusTabbableAndAssert(); - } - - function focusTabbableAndAssert() { - element.dialog( "instance" )._focusTabbable(); - setTimeout( function() { - assert.equal( document.activeElement, input[ 0 ], - "1. an element that was focused previously." ); - done(); - } ); - } + element.dialog( "instance" )._focusTabbable(); + setTimeout( function() { + assert.equal( document.activeElement, input[ 0 ], + "1. an element that was focused previously." ); + done(); + } ); }, step2 ); } @@ -303,11 +278,6 @@ QUnit.test( "interaction between overlay and other dialogs", function( assert ) second = $( "<div><input id='input-2'></div>" ).testWidget(), secondInput = second.find( "input" ); - // Support: IE8 - // For some reason the focus doesn't get set properly if we don't - // focus the body first. - $( "body" ).trigger( "focus" ); - // Wait for the modal to init setTimeout( function() { diff --git a/tests/unit/dialog/methods.js b/tests/unit/dialog/methods.js index 1de32194b..c3f360fb9 100644 --- a/tests/unit/dialog/methods.js +++ b/tests/unit/dialog/methods.js @@ -226,11 +226,6 @@ QUnit.test( "#8958: dialog can be opened while opening", function( assert ) { } } ); - // Support: IE8 - // For some reason the #favorite-animal input doesn't get focus if we don't - // focus the body first, causing the test to hang. - $( "body" ).trigger( "focus" ); - $( "#favorite-animal" ) // We focus the input to start the test. Once it receives focus, the diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js index 46c856d4e..d7f786c93 100644 --- a/tests/unit/draggable/core.js +++ b/tests/unit/draggable/core.js @@ -38,8 +38,8 @@ QUnit.test( "element types", function( assert ) { } ); offsetAfter = el.offset(); - // Support: FF, Chrome, and IE9, - // there are some rounding errors in so we can't say equal, we have to settle for close enough + // Support: Firefox, Chrome + // There are some rounding errors, so we can't say equal, we have to settle for close enough assert.close( offsetBefore.left, offsetAfter.left - 50, 1, "dragged[50, 50] " + "<" + typeName + "> left" ); assert.close( offsetBefore.top, offsetAfter.top - 50, 1, "dragged[50, 50] " + "<" + typeName + "> top" ); el.draggable( "destroy" ); @@ -112,7 +112,6 @@ QUnit.test( "Stray mousemove after mousedown still drags", function( assert ) { // In IE8, when content is placed under the mouse (e.g. when draggable content is replaced // on mousedown), mousemove is triggered on those elements even though the mouse hasn't moved. - // Support: IE <9 element.on( "mousedown", function() { $( document ).simulate( "mousemove", { button: -1 } ); } ); @@ -341,11 +340,13 @@ QUnit.test( "blur behavior - off handle", function( assert ) { var element = $( "#draggable2" ).draggable( { handle: "span" } ), focusElement = $( "<div tabindex='1'></div>" ).appendTo( element ); - // Mock $.ui.safeBlur with a spy - var _safeBlur = $.ui.safeBlur; + // Mock $.ui.trigger with a spy + var _trigger = $.fn.trigger; var blurCalledCount = 0; - $.ui.safeBlur = function() { - blurCalledCount++; + $.fn.trigger = function( eventName ) { + if ( eventName === "blur" ) { + blurCalledCount++; + } }; testHelper.onFocus( focusElement, function() { @@ -357,8 +358,8 @@ QUnit.test( "blur behavior - off handle", function( assert ) { testHelper.move( element.find( "span" ), 1, 1 ); assert.strictEqual( blurCalledCount, 1, "draggable blurs when mousing down on handle" ); - // Restore safeBlur - $.ui.safeBlur = _safeBlur; + // Restore trigger + $.fn.trigger = _trigger; ready(); } ); @@ -394,27 +395,21 @@ QUnit.test( "ui-draggable-handle managed correctly in nested draggables", functi assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" ); } ); -// Support: IE 8 only -// IE 8 implements DOM Level 2 Events which only has events bubble up to the document. -// We skip this test since it would be impossible for it to pass in such an environment. -QUnit[ document.documentMode === 8 ? "skip" : "test" ]( - "does not stop propagation to window", - function( assert ) { - assert.expect( 1 ); - var element = $( "#draggable1" ).draggable(); +QUnit.test( "does not stop propagation to window", function( assert ) { + assert.expect( 1 ); + var element = $( "#draggable1" ).draggable(); - var handler = function() { - assert.ok( true, "mouseup propagates to window" ); - }; - $( window ).on( "mouseup", handler ); + var handler = function() { + assert.ok( true, "mouseup propagates to window" ); + }; + $( window ).on( "mouseup", handler ); - element.simulate( "drag", { - dx: 10, - dy: 10 - } ); + element.simulate( "drag", { + dx: 10, + dy: 10 + } ); - $( window ).off( "mouseup", handler ); - } -); + $( window ).off( "mouseup", handler ); +} ); } ); diff --git a/tests/unit/draggable/helper.js b/tests/unit/draggable/helper.js index 292b75bf0..2fd637a24 100644 --- a/tests/unit/draggable/helper.js +++ b/tests/unit/draggable/helper.js @@ -8,9 +8,6 @@ define( [ return $.extend( helper, { - // TODO: remove the unreliable offset hacks - unreliableOffset: $.ui.ie && ( !document.documentMode || document.documentMode < 8 ) ? 2 : 0, - testDragPosition: function( assert, el, dx, dy, expectedDX, expectedDY, msg ) { msg = msg ? msg + "." : ""; diff --git a/tests/unit/draggable/options.js b/tests/unit/draggable/options.js index 79aac27c2..f97696920 100644 --- a/tests/unit/draggable/options.js +++ b/tests/unit/draggable/options.js @@ -743,11 +743,11 @@ QUnit.test( "cursorAt", function( assert ) { assert.equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" ); assert.equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" ); } else if ( testData.cursorAt.right ) { - assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - testHelper.unreliableOffset, testName + " " + position + " left" ); - assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - testHelper.unreliableOffset, testName + " " + position + " top" ); + assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" ); + assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + " " + position + " top" ); } else { - assert.equal( event.clientX - ui.offset.left, testData.x + testHelper.unreliableOffset, testName + " " + position + " left" ); - assert.equal( event.clientY - ui.offset.top, testData.y + testHelper.unreliableOffset, testName + " " + position + " top" ); + assert.equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" ); + assert.equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" ); } } } ); @@ -785,11 +785,11 @@ QUnit.test( "cursorAt, switching after initialization", function( assert ) { assert.equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" ); assert.equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" ); } else if ( testData.cursorAt.right ) { - assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - testHelper.unreliableOffset, testName + " " + position + " left" ); - assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - testHelper.unreliableOffset, testName + " " + position + " top" ); + assert.equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x, testName + " " + position + " left" ); + assert.equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y, testName + " " + position + " top" ); } else { - assert.equal( event.clientX - ui.offset.left, testData.x + testHelper.unreliableOffset, testName + " " + position + " left" ); - assert.equal( event.clientY - ui.offset.top, testData.y + testHelper.unreliableOffset, testName + " " + position + " top" ); + assert.equal( event.clientX - ui.offset.left, testData.x, testName + " " + position + " left" ); + assert.equal( event.clientY - ui.offset.top, testData.y, testName + " " + position + " top" ); } } } ); @@ -1136,15 +1136,6 @@ QUnit.test( "scroll ignores containers that are overflow: hidden", function( ass dy: 1300 } ); - // IE8 natively scrolls when dragging an element inside a overflow:hidden - // container, so skip this test if native scroll occurs. - // Support: IE <9 - if ( scrollParent.scrollTop() > 0 ) { - assert.ok( true, "overflow:hidden container natively scrolls" ); - assert.ok( true, "overflow:hidden container natively scrolls" ); - return; - } - element.css( { top: 0, left: 0 } ).draggable( "option", "scroll", true ); element.simulate( "drag", { @@ -1458,7 +1449,7 @@ QUnit.test( "zIndex, default, switching after initialization", function( assert } ); QUnit.test( "iframeFix", function( assert ) { - assert.expect( 6 ); + assert.expect( 5 ); var element = $( "<div>" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: true } ), element2 = $( "<div>" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: ".iframe" } ), @@ -1474,8 +1465,7 @@ QUnit.test( "iframeFix", function( assert ) { } ); element.one( "drag", function() { - var divOffset, iframeOffset, - div = $( this ).children().not( "iframe" ); + var div = $( this ).children().not( "iframe" ); // https://bugs.jqueryui.com/ticket/9671 // iframeFix doesn't handle iframes that move @@ -1483,13 +1473,7 @@ QUnit.test( "iframeFix", function( assert ) { assert.equal( div.outerWidth(), iframe.outerWidth(), "blocking div is wide enough" ); assert.equal( div.outerHeight(), iframe.outerHeight(), "blocking div is tall enough" ); - divOffset = div.offset(); - iframeOffset = iframe.offset(); - - // Support: Edge <79 only - // In Edge Legacy these values differ a little. - assert.ok( Math.abs( divOffset.top - iframeOffset.top ) < 0.25, "Check top within 0.25 of expected" ); - assert.ok( Math.abs( divOffset.left - iframeOffset.left ) < 0.25, "Check left within 0.25 of expected" ); + assert.deepEqual( div.offset(), iframe.offset(), "blocking div is tall enough" ); } ); element.simulate( "drag", { diff --git a/tests/unit/menu/events.js b/tests/unit/menu/events.js index caac7e741..f03ba333c 100644 --- a/tests/unit/menu/events.js +++ b/tests/unit/menu/events.js @@ -54,17 +54,11 @@ QUnit.test( "handle click on custom item menu", function( assert ) { QUnit.test( "handle blur", function( assert ) { var ready = assert.async(); assert.expect( 2 ); - var blurHandled = false, - index = 1, + var index = 1, element = $( "#menu1" ).menu( { blur: function( event, ui ) { - - // Ignore duplicate blur event fired by IE - if ( !blurHandled ) { - blurHandled = true; - assert.equal( event.type, "menublur", "blur event.type is 'menublur'" ); - assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" ); - } + assert.equal( event.type, "menublur", "blur event.type is 'menublur'" ); + assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" ); } } ); @@ -80,17 +74,11 @@ QUnit.test( "handle blur", function( assert ) { QUnit.test( "handle blur via click outside", function( assert ) { var ready = assert.async(); assert.expect( 2 ); - var blurHandled = false, - index = 1, + var index = 1, element = $( "#menu1" ).menu( { blur: function( event, ui ) { - - // Ignore duplicate blur event fired by IE - if ( !blurHandled ) { - blurHandled = true; - assert.equal( event.type, "menublur", "blur event.type is 'menublur'" ); - assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" ); - } + assert.equal( event.type, "menublur", "blur event.type is 'menublur'" ); + assert.strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" ); } } ); diff --git a/tests/unit/sortable/options.js b/tests/unit/sortable/options.js index 0905de73c..3792d433f 100644 --- a/tests/unit/sortable/options.js +++ b/tests/unit/sortable/options.js @@ -294,17 +294,8 @@ QUnit.test( "{ forcePlaceholderSize: true } table rows", function( assert ) { placeholder: "test", forcePlaceholderSize: true, start: function( event, ui ) { - - // Support: IE 11+, Edge <79 only - // In IE & Edge Legacy these values may differ a little - // when jQuery >=3.0 <3.2 is used. - if ( jqMinor === "3.0." || jqMinor === "3.1." ) { - assert.ok( Math.abs( ui.placeholder.height() - ui.item.height() ) < 0.25, - "placeholder height is within 0.25 px of item's" ); - } else { - assert.equal( ui.placeholder.height(), ui.item.height(), - "placeholder is same height as item" ); - } + assert.equal( ui.placeholder.height(), ui.item.height(), + "placeholder is same height as item" ); } } ); diff --git a/tests/unit/widget/core.js b/tests/unit/widget/core.js index 1054bf092..fe74e18e9 100644 --- a/tests/unit/widget/core.js +++ b/tests/unit/widget/core.js @@ -293,9 +293,7 @@ QUnit.test( "._getCreateOptions()", function( assert ) { assert.deepEqual( superOptions, {}, "Base implementation returns empty object" ); - // Support: IE8 - // Strict equality fails when comparing this.window in ie8 - assert.equal( this.window[ 0 ], window, "this.window is properly defined" ); + assert.strictEqual( this.window[ 0 ], window, "this.window is properly defined" ); assert.strictEqual( this.document[ 0 ], document, "this.document is properly defined" ); return { diff --git a/themes/base/button.css b/themes/base/button.css index f6780cb15..c432b4abc 100644 --- a/themes/base/button.css +++ b/themes/base/button.css @@ -18,12 +18,7 @@ vertical-align: middle; text-align: center; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; user-select: none; - - /* Support: IE <= 11 */ - overflow: visible; } .ui-button, @@ -74,7 +69,7 @@ input.ui-button.ui-icon-notext .ui-icon { } /* workarounds */ -/* Support: Firefox 5 - 40 */ +/* Support: Firefox 5 - 125+ */ input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { border: 0; diff --git a/themes/base/controlgroup.css b/themes/base/controlgroup.css index 24048bd79..cd9e4e520 100644 --- a/themes/base/controlgroup.css +++ b/themes/base/controlgroup.css @@ -54,9 +54,6 @@ /* Spinner specific style fixes */ .ui-controlgroup-vertical .ui-spinner-input { - - /* Support: IE8 only, Android < 4.4 only */ - width: 75%; width: calc( 100% - 2.4em ); } .ui-controlgroup-vertical .ui-spinner .ui-spinner-up { diff --git a/themes/base/core.css b/themes/base/core.css index 6917bb6d4..2bea103b5 100644 --- a/themes/base/core.css +++ b/themes/base/core.css @@ -50,7 +50,6 @@ left: 0; position: absolute; opacity: 0; - -ms-filter: "alpha(opacity=0)"; /* support: IE8 */ } .ui-front { diff --git a/themes/base/draggable.css b/themes/base/draggable.css index c77269d93..4183f5ac4 100644 --- a/themes/base/draggable.css +++ b/themes/base/draggable.css @@ -7,6 +7,5 @@ * https://jquery.org/license */ .ui-draggable-handle { - -ms-touch-action: none; touch-action: none; } diff --git a/themes/base/menu.css b/themes/base/menu.css index 83e165a5d..e35c9e8bf 100644 --- a/themes/base/menu.css +++ b/themes/base/menu.css @@ -21,8 +21,6 @@ .ui-menu .ui-menu-item { margin: 0; cursor: pointer; - /* support: IE10, see #8844 */ - list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); } .ui-menu .ui-menu-item-wrapper { position: relative; diff --git a/themes/base/progressbar.css b/themes/base/progressbar.css index 6c379e5bd..e1abfab46 100644 --- a/themes/base/progressbar.css +++ b/themes/base/progressbar.css @@ -20,7 +20,6 @@ .ui-progressbar .ui-progressbar-overlay { background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); height: 100%; - -ms-filter: "alpha(opacity=25)"; /* support: IE8 */ opacity: 0.25; } .ui-progressbar-indeterminate .ui-progressbar-value { diff --git a/themes/base/resizable.css b/themes/base/resizable.css index 35cd3034d..8a48c427e 100644 --- a/themes/base/resizable.css +++ b/themes/base/resizable.css @@ -13,7 +13,6 @@ position: absolute; font-size: 0.1px; display: block; - -ms-touch-action: none; touch-action: none; } .ui-resizable-disabled .ui-resizable-handle, diff --git a/themes/base/selectable.css b/themes/base/selectable.css index 4b749755c..cb770e7cc 100644 --- a/themes/base/selectable.css +++ b/themes/base/selectable.css @@ -7,7 +7,6 @@ * https://jquery.org/license */ .ui-selectable { - -ms-touch-action: none; touch-action: none; } .ui-selectable-helper { diff --git a/themes/base/slider.css b/themes/base/slider.css index d6d261c42..134bf14b2 100644 --- a/themes/base/slider.css +++ b/themes/base/slider.css @@ -18,7 +18,6 @@ width: 1.2em; height: 1.2em; cursor: pointer; - -ms-touch-action: none; touch-action: none; } .ui-slider .ui-slider-range { @@ -30,12 +29,6 @@ background-position: 0 0; } -/* support: IE8 - See #6727 */ -.ui-slider.ui-state-disabled .ui-slider-handle, -.ui-slider.ui-state-disabled .ui-slider-range { - filter: inherit; -} - .ui-slider-horizontal { height: .8em; } diff --git a/themes/base/sortable.css b/themes/base/sortable.css index fe54de6ab..dc698ded8 100644 --- a/themes/base/sortable.css +++ b/themes/base/sortable.css @@ -7,6 +7,5 @@ * https://jquery.org/license */ .ui-sortable-handle { - -ms-touch-action: none; touch-action: none; } diff --git a/themes/base/theme.css b/themes/base/theme.css index eb1097b82..d99a47bbc 100644 --- a/themes/base/theme.css +++ b/themes/base/theme.css @@ -172,19 +172,14 @@ a.ui-button:active, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; - -ms-filter: "alpha(opacity=70)"; /* support: IE8 */ font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; - -ms-filter: "alpha(opacity=35)"; /* support: IE8 */ background-image: none; } -.ui-state-disabled .ui-icon { - -ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ -} /* Icons ----------------------------------*/ @@ -438,9 +433,7 @@ a.ui-button:active, .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ /*{bgImgUrlOverlay}*/ /*{bgOverlayXPos}*/ /*{bgOverlayYPos}*/ /*{bgOverlayRepeat}*/; opacity: .3/*{opacityOverlay}*/; - -ms-filter: "alpha(opacity=30)"/*{opacityFilterOverlay}*/; /* support: IE8 */ } .ui-widget-shadow { - -webkit-box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/; box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/; } diff --git a/ui/core.js b/ui/core.js index 862851391..33d7974e2 100644 --- a/ui/core.js +++ b/ui/core.js @@ -7,14 +7,10 @@ define( [ "./data", "./disable-selection", "./focusable", - "./form", - "./ie", "./keycode", "./labels", "./jquery-patch", "./plugin", - "./safe-active-element", - "./safe-blur", "./scroll-parent", "./tabbable", "./unique-id", diff --git a/ui/effect.js b/ui/effect.js index ac9b0c809..bbbb733c3 100644 --- a/ui/effect.js +++ b/ui/effect.js @@ -81,26 +81,14 @@ function camelCase( string ) { function getElementStyles( elem ) { var key, len, - style = elem.ownerDocument.defaultView ? - elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : - elem.currentStyle, + style = elem.ownerDocument.defaultView.getComputedStyle( elem ), styles = {}; - if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { - len = style.length; - while ( len-- ) { - key = style[ len ]; - if ( typeof style[ key ] === "string" ) { - styles[ camelCase( key ) ] = style[ key ]; - } - } - - // Support: Opera, IE <9 - } else { - for ( key in style ) { - if ( typeof style[ key ] === "string" ) { - styles[ key ] = style[ key ]; - } + len = style.length; + while ( len-- ) { + key = style[ len ]; + if ( typeof style[ key ] === "string" ) { + styles[ camelCase( key ) ] = style[ key ]; } } diff --git a/ui/focusable.js b/ui/focusable.js index 2db058678..4920417fc 100644 --- a/ui/focusable.js +++ b/ui/focusable.js @@ -62,20 +62,10 @@ $.ui.focusable = function( element, hasTabindex ) { focusableIfVisible = hasTabindex; } - return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); + return focusableIfVisible && $( element ).is( ":visible" ) && + $( element ).css( "visibility" ) === "visible"; }; -// Support: IE 8 only -// IE 8 doesn't resolve inherit to visible/hidden for computed values -function visible( element ) { - var visibility = element.css( "visibility" ); - while ( visibility === "inherit" ) { - element = element.parent(); - visibility = element.css( "visibility" ); - } - return visibility === "visible"; -} - $.extend( $.expr.pseudos, { focusable: function( element ) { return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); diff --git a/ui/form-reset-mixin.js b/ui/form-reset-mixin.js index a60299d13..9a2e73aac 100644 --- a/ui/form-reset-mixin.js +++ b/ui/form-reset-mixin.js @@ -20,7 +20,6 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "./form", "./version" ], factory ); } else { @@ -45,7 +44,7 @@ return $.ui.formResetMixin = { }, _bindFormResetHandler: function() { - this.form = this.element._form(); + this.form = $( this.element.prop( "form" ) ); if ( !this.form.length ) { return; } diff --git a/ui/form.js b/ui/form.js deleted file mode 100644 index 60b052277..000000000 --- a/ui/form.js +++ /dev/null @@ -1,23 +0,0 @@ -( function( factory ) { - "use strict"; - - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -// Support: IE8 Only -// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop -// with a string, so we need to find the proper form. -return $.fn._form = function() { - return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); -}; - -} ); diff --git a/ui/ie.js b/ui/ie.js deleted file mode 100644 index 1754b94a9..000000000 --- a/ui/ie.js +++ /dev/null @@ -1,18 +0,0 @@ -( function( factory ) { - "use strict"; - - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -// This file is deprecated -return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); -} ); diff --git a/ui/labels.js b/ui/labels.js index 9f1c3296b..4f6533451 100644 --- a/ui/labels.js +++ b/ui/labels.js @@ -39,9 +39,8 @@ return $.fn.labels = function() { return this.pushStack( this[ 0 ].labels ); } - // Support: IE <= 11, FF <= 37, Android <= 2.3 only - // Above browsers do not support control.labels. Everything below is to support them - // as well as document fragments. control.labels does not work on document fragments + // If `control.labels` is empty - e.g. inside of document fragments - find + // the labels manually labels = this.eq( 0 ).parents( "label" ); // Look for the label based on the id diff --git a/ui/safe-active-element.js b/ui/safe-active-element.js deleted file mode 100644 index 9d6968e08..000000000 --- a/ui/safe-active-element.js +++ /dev/null @@ -1,44 +0,0 @@ -( function( factory ) { - "use strict"; - - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -return $.ui.safeActiveElement = function( document ) { - var activeElement; - - // Support: IE 9 only - // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> - try { - activeElement = document.activeElement; - } catch ( error ) { - activeElement = document.body; - } - - // Support: IE 9 - 11 only - // IE may return null instead of an element - // Interestingly, this only seems to occur when NOT in an iframe - if ( !activeElement ) { - activeElement = document.body; - } - - // Support: IE 11 only - // IE11 returns a seemingly empty object in some cases when accessing - // document.activeElement from an <iframe> - if ( !activeElement.nodeName ) { - activeElement = document.body; - } - - return activeElement; -}; - -} ); diff --git a/ui/safe-blur.js b/ui/safe-blur.js deleted file mode 100644 index c0b3b8a1e..000000000 --- a/ui/safe-blur.js +++ /dev/null @@ -1,25 +0,0 @@ -( function( factory ) { - "use strict"; - - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ "jquery", "./version" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -} )( function( $ ) { -"use strict"; - -return $.ui.safeBlur = function( element ) { - - // Support: IE9 - 10 only - // If the <body> is blurred, IE will switch windows, see #9420 - if ( element && element.nodeName.toLowerCase() !== "body" ) { - $( element ).trigger( "blur" ); - } -}; - -} ); diff --git a/ui/widgets/accordion.js b/ui/widgets/accordion.js index d5d71224d..b6a7a7eee 100644 --- a/ui/widgets/accordion.js +++ b/ui/widgets/accordion.js @@ -187,13 +187,7 @@ return $.widget( "ui.accordion", { this._super( value ); this.element.attr( "aria-disabled", value ); - - // Support: IE8 Only - // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE - // so we need to add the disabled class to the headers and panels this._toggleClass( null, "ui-state-disabled", !!value ); - this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled", - !!value ); }, _keydown: function( event ) { @@ -611,10 +605,6 @@ return $.widget( "ui.accordion", { this._removeClass( prev, "ui-accordion-header-active" ) ._addClass( prev, "ui-accordion-header-collapsed" ); - // Work around for rendering bug in IE (#5421) - if ( toHide.length ) { - toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; - } this._trigger( "activate", null, data ); } } ); diff --git a/ui/widgets/autocomplete.js b/ui/widgets/autocomplete.js index ac2cfe42b..57e59820c 100644 --- a/ui/widgets/autocomplete.js +++ b/ui/widgets/autocomplete.js @@ -27,7 +27,6 @@ "./menu", "../keycode", "../position", - "../safe-active-element", "../version", "../widget" ], factory ); @@ -84,9 +83,9 @@ $.widget( "ui.autocomplete", { // Textareas are always multi-line // Inputs are always single-line, even if inside a contentEditable element - // IE also treats inputs as contentEditable - // All other element types are determined by whether or not they're contentEditable - this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element ); + // All other element types are determined by whether they're contentEditable + this.isMultiLine = isTextarea || + !isInput && this.element.prop( "contentEditable" ) === "true"; this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; this.isNewMenu = true; @@ -150,7 +149,6 @@ $.widget( "ui.autocomplete", { // Different browsers have different default behavior for escape // Single press can mean undo or clear - // Double press in IE means clear the whole form event.preventDefault(); } break; @@ -219,16 +217,6 @@ $.widget( "ui.autocomplete", { role: null } ) .hide() - - // Support: IE 11 only, Edge <= 14 - // For other browsers, we preventDefault() on the mousedown event - // to keep the dropdown from taking focus from the input. This doesn't - // work for IE/Edge, causing problems with selection and scrolling (#9638) - // Happily, IE and Edge support an "unselectable" attribute that - // prevents an element from receiving focus, exactly what we want here. - .attr( { - "unselectable": "on" - } ) .menu( "instance" ); this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); @@ -241,7 +229,7 @@ $.widget( "ui.autocomplete", { menufocus: function( event, ui ) { var label, item; - // support: Firefox + // Support: Firefox // Prevent accidental activation of menu items in Firefox (#7024 #9118) if ( this.isNewMenu ) { this.isNewMenu = false; @@ -279,17 +267,9 @@ $.widget( "ui.autocomplete", { previous = this.previous; // Only trigger when focus was lost (click on menu) - if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { + if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) { this.element.trigger( "focus" ); this.previous = previous; - - // #6109 - IE triggers two focus events and the second - // is asynchronous, so we need to reset the previous - // term synchronously and asynchronously :-( - this._delay( function() { - this.previous = previous; - this.selectedItem = item; - } ); } if ( false !== this._trigger( "select", event, { item: item } ) ) { @@ -608,24 +588,6 @@ $.widget( "ui.autocomplete", { // Prevents moving cursor to beginning/end of the text field in some browsers event.preventDefault(); } - }, - - // Support: Chrome <=50 - // We should be able to just use this.element.prop( "isContentEditable" ) - // but hidden elements always report false in Chrome. - // https://code.google.com/p/chromium/issues/detail?id=313082 - _isContentEditable: function( element ) { - if ( !element.length ) { - return false; - } - - var editable = element.prop( "contentEditable" ); - - if ( editable === "inherit" ) { - return this._isContentEditable( element.parent() ); - } - - return editable === "true"; } } ); diff --git a/ui/widgets/button.js b/ui/widgets/button.js index 02708d620..08a4b61c5 100644 --- a/ui/widgets/button.js +++ b/ui/widgets/button.js @@ -109,9 +109,9 @@ $.widget( "ui.button", { if ( event.keyCode === $.ui.keyCode.SPACE ) { event.preventDefault(); - // Support: PhantomJS <= 1.9, IE 8 Only - // If a native click is available use it so we actually cause navigation - // otherwise just trigger a click event + // If a native click is available use it, so we + // actually cause navigation. Otherwise, just trigger + // a click event. if ( this.element[ 0 ].click ) { this.element[ 0 ].click(); } else { diff --git a/ui/widgets/checkboxradio.js b/ui/widgets/checkboxradio.js index add80d80a..fc812116e 100644 --- a/ui/widgets/checkboxradio.js +++ b/ui/widgets/checkboxradio.js @@ -168,7 +168,7 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { // Not inside a form, check all inputs that also are not inside a form group = $( nameSelector ).filter( function() { - return $( this )._form().length === 0; + return $( $( this ).prop( "form" ) ).length === 0; } ); } diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js index cbda81636..4ba9d1117 100644 --- a/ui/widgets/dialog.js +++ b/ui/widgets/dialog.js @@ -31,8 +31,6 @@ "../focusable", "../keycode", "../position", - "../safe-active-element", - "../safe-blur", "../tabbable", "../unique-id", "../version", @@ -229,7 +227,7 @@ $.widget( "ui.dialog", { // Hiding a focused element doesn't trigger blur in WebKit // so in case we have nothing to focus on, explicitly blur the active element // https://bugs.webkit.org/show_bug.cgi?id=47182 - $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); + $( this.document[ 0 ].activeElement ).trigger( "blur" ); } this._hide( this.uiDialog, this.options.hide, function() { @@ -273,7 +271,7 @@ $.widget( "ui.dialog", { } this._isOpen = true; - this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); + this.opener = $( this.document[ 0 ].activeElement ); this._size(); this._position(); @@ -329,7 +327,7 @@ $.widget( "ui.dialog", { }, _restoreTabbableFocus: function() { - var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), + var activeElement = this.document[ 0 ].activeElement, isActive = this.uiDialog[ 0 ] === activeElement || $.contains( this.uiDialog[ 0 ], activeElement ); if ( !isActive ) { @@ -340,11 +338,6 @@ $.widget( "ui.dialog", { _keepFocus: function( event ) { event.preventDefault(); this._restoreTabbableFocus(); - - // support: IE - // IE <= 8 doesn't prevent moving focus even with event.preventDefault() - // so we check again later - this._delay( this._restoreTabbableFocus ); }, _createWrapper: function() { @@ -427,9 +420,6 @@ $.widget( "ui.dialog", { } } ); - // Support: IE - // Use type="button" to prevent enter keypresses in textboxes from closing the - // dialog in IE (#9312) this.uiDialogTitlebarClose = $( "<button type='button'></button>" ) .button( { label: $( "<a>" ).text( this.options.closeText ).html(), diff --git a/ui/widgets/draggable.js b/ui/widgets/draggable.js index 91443fac5..e0abdd26f 100644 --- a/ui/widgets/draggable.js +++ b/ui/widgets/draggable.js @@ -25,8 +25,6 @@ "./mouse", "../data", "../plugin", - "../safe-active-element", - "../safe-blur", "../scroll-parent", "../version", "../widget" @@ -147,7 +145,7 @@ $.widget( "ui.draggable", $.ui.mouse, { }, _blurActiveElement: function( event ) { - var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), + var activeElement = this.document[ 0 ].activeElement, target = $( event.target ); // Don't blur if the event occurred on an element that is within @@ -158,7 +156,7 @@ $.widget( "ui.draggable", $.ui.mouse, { } // Blur any element that currently has focus, see #4261 - $.ui.safeBlur( activeElement ); + $( activeElement ).trigger( "blur" ); }, _mouseStart: function( event ) { diff --git a/ui/widgets/menu.js b/ui/widgets/menu.js index 1ef4b8a3d..f3fdc82c8 100644 --- a/ui/widgets/menu.js +++ b/ui/widgets/menu.js @@ -26,7 +26,6 @@ "jquery", "../keycode", "../position", - "../safe-active-element", "../unique-id", "../version", "../widget" @@ -87,7 +86,7 @@ return $.widget( "ui.menu", { }, "click .ui-menu-item": function( event ) { var target = $( event.target ); - var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); + var active = $( this.document[ 0 ].activeElement ); if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { this.select( event ); @@ -131,7 +130,7 @@ return $.widget( "ui.menu", { this._delay( function() { var notContained = !$.contains( this.element[ 0 ], - $.ui.safeActiveElement( this.document[ 0 ] ) + this.document[ 0 ].activeElement ); if ( notContained ) { this.collapseAll( event ); diff --git a/ui/widgets/mouse.js b/ui/widgets/mouse.js index 1dcac5277..ef9dd8dbe 100644 --- a/ui/widgets/mouse.js +++ b/ui/widgets/mouse.js @@ -20,7 +20,6 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "../ie", "../version", "../widget" ], factory ); @@ -90,12 +89,10 @@ return $.widget( "ui.mouse", { this._mouseDownEvent = event; var that = this, - btnIsLeft = ( event.which === 1 ), - - // event.target.nodeName works around a bug in IE 8 with - // disabled inputs (#7620) - elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? - $( event.target ).closest( this.options.cancel ).length : false ); + btnIsLeft = event.which === 1, + elIsCancel = typeof this.options.cancel === "string" ? + $( event.target ).closest( this.options.cancel ).length : + false; if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { return true; } @@ -141,28 +138,17 @@ return $.widget( "ui.mouse", { _mouseMove: function( event ) { // Only check for mouseups outside the document if you've moved inside the document - // at least once. This prevents the firing of mouseup in the case of IE<9, which will - // fire a mousemove event if content is placed under the cursor. See #7778 - // Support: IE <9 - if ( this._mouseMoved ) { - - // IE mouseup check - mouseup happened when mouse was out of window - if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && - !event.button ) { + // at least once. + if ( this._mouseMoved && !event.which ) { + + // Support: Safari <=8 - 9 + // Safari sets which to 0 if you press any of the following keys + // during a drag (#14461) + if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || + event.originalEvent.metaKey || event.originalEvent.shiftKey ) { + this.ignoreMissingWhich = true; + } else if ( !this.ignoreMissingWhich ) { return this._mouseUp( event ); - - // Iframe mouseup check - mouseup occurred in another document - } else if ( !event.which ) { - - // Support: Safari <=8 - 9 - // Safari sets which to 0 if you press any of the following keys - // during a drag (#14461) - if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || - event.originalEvent.metaKey || event.originalEvent.shiftKey ) { - this.ignoreMissingWhich = true; - } else if ( !this.ignoreMissingWhich ) { - return this._mouseUp( event ); - } } } diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js index e163b03fe..1698d55e8 100644 --- a/ui/widgets/resizable.js +++ b/ui/widgets/resizable.js @@ -149,9 +149,8 @@ $.widget( "ui.resizable", $.ui.mouse, { }; this.element.css( margins ); - this.originalElement.css( "margin", 0 ); - // support: Safari + // Support: Safari // Prevent Safari textarea resize this.originalResizeStyle = this.originalElement.css( "resize" ); this.originalElement.css( "resize", "none" ); @@ -162,10 +161,6 @@ $.widget( "ui.resizable", $.ui.mouse, { display: "block" } ) ); - // Support: IE9 - // avoid IE jump (hard set the margin) - this.originalElement.css( margins ); - this._proportionallyResize(); } diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js index b1e2033ba..eecd368f5 100644 --- a/ui/widgets/selectmenu.js +++ b/ui/widgets/selectmenu.js @@ -167,12 +167,6 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { role: "listbox", select: function( event, ui ) { event.preventDefault(); - - // Support: IE8 - // If the item was selected via a click, the text selection - // will be destroyed in IE - that._setSelection(); - that._select( ui.item.data( "ui-selectmenu-item" ), event ); }, focus: function( event, ui ) { @@ -409,20 +403,9 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { return; } - if ( window.getSelection ) { - selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange( this.range ); - - // Support: IE8 - } else { - this.range.select(); - } - - // Support: IE - // Setting the text selection kills the button focus in IE, but - // restoring the focus doesn't kill the selection. - this.button.trigger( "focus" ); + selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange( this.range ); }, _documentClick: { @@ -442,17 +425,9 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { // Prevent text selection from being reset when interacting with the selectmenu (#10144) mousedown: function() { - var selection; - - if ( window.getSelection ) { - selection = window.getSelection(); - if ( selection.rangeCount ) { - this.range = selection.getRangeAt( 0 ); - } - - // Support: IE8 - } else { - this.range = document.selection.createRange(); + var selection = window.getSelection(); + if ( selection.rangeCount ) { + this.range = selection.getRangeAt( 0 ); } }, @@ -643,11 +618,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { _resizeMenu: function() { this.menu.outerWidth( Math.max( this.button.outerWidth(), - - // Support: IE10 - // IE10 wraps long text (possibly a rounding bug) - // so we add 1px to avoid the wrapping - this.menu.width( "" ).outerWidth() + 1 + this.menu.width( "" ).outerWidth() ) ); }, diff --git a/ui/widgets/sortable.js b/ui/widgets/sortable.js index 70dc7e703..32333b6f5 100644 --- a/ui/widgets/sortable.js +++ b/ui/widgets/sortable.js @@ -24,7 +24,6 @@ "jquery", "./mouse", "../data", - "../ie", "../scroll-parent", "../version", "../widget" @@ -276,10 +275,6 @@ return $.widget( "ui.sortable", $.ui.mouse, { if ( o.cursor && o.cursor !== "auto" ) { // cursor option body = this.document.find( "body" ); - // Support: IE - this.storedCursor = body.css( "cursor" ); - body.css( "cursor", o.cursor ); - this.storedStylesheet = $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); } @@ -1197,11 +1192,9 @@ return $.widget( "ui.sortable", $.ui.mouse, { po.top += this.scrollParent.scrollTop(); } - // This needs to be actually done for all browsers, since pageX/pageY includes this - // information with an ugly IE fix - if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || - ( this.offsetParent[ 0 ].tagName && - this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { + // This needs to be actually done for all browsers, since pageX/pageY includes + // this information. + if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) { po = { top: 0, left: 0 }; } @@ -1549,8 +1542,7 @@ return $.widget( "ui.sortable", $.ui.mouse, { } //Do what was originally in plugins - if ( this.storedCursor ) { - this.document.find( "body" ).css( "cursor", this.storedCursor ); + if ( this.storedStylesheet ) { this.storedStylesheet.remove(); } if ( this._storedOpacity ) { diff --git a/ui/widgets/spinner.js b/ui/widgets/spinner.js index b92b8ab52..d999d85d7 100644 --- a/ui/widgets/spinner.js +++ b/ui/widgets/spinner.js @@ -27,7 +27,6 @@ "./button", "../version", "../keycode", - "../safe-active-element", "../widget" ], factory ); } else { @@ -131,11 +130,6 @@ $.widget( "ui.spinner", { this.previous = this.element.val(); }, blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - this._stop(); this._refresh(); if ( this.previous !== this.element.val() ) { @@ -143,7 +137,7 @@ $.widget( "ui.spinner", { } }, mousewheel: function( event, delta ) { - var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ); + var activeElement = this.document[ 0 ].activeElement; var isActive = this.element[ 0 ] === activeElement; if ( !isActive || !delta ) { @@ -171,20 +165,13 @@ $.widget( "ui.spinner", { // If the input is focused then this.previous is properly set from // when the input first received focus. If the input is not focused // then we need to set this.previous based on the value before spinning. - previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ? + previous = this.element[ 0 ] === this.document[ 0 ].activeElement ? this.previous : this.element.val(); function checkFocus() { - var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ); + var isActive = this.element[ 0 ] === this.document[ 0 ].activeElement; if ( !isActive ) { this.element.trigger( "focus" ); this.previous = previous; - - // support: IE - // IE sets focus asynchronously, so we need to check if focus - // moved off of the input because the user clicked on the button. - this._delay( function() { - this.previous = previous; - } ); } } @@ -192,16 +179,6 @@ $.widget( "ui.spinner", { event.preventDefault(); checkFocus.call( this ); - // Support: IE - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - // and check (again) if focus moved off of the input. - this.cancelBlur = true; - this._delay( function() { - delete this.cancelBlur; - checkFocus.call( this ); - } ); - if ( this._start( event ) === false ) { return; } diff --git a/ui/widgets/tabs.js b/ui/widgets/tabs.js index 465b48cec..e191dfbb4 100644 --- a/ui/widgets/tabs.js +++ b/ui/widgets/tabs.js @@ -25,7 +25,6 @@ define( [ "jquery", "../keycode", - "../safe-active-element", "../unique-id", "../version", "../widget" @@ -171,7 +170,7 @@ $.widget( "ui.tabs", { }, _tabKeydown: function( event ) { - var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ), + var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ), selectedIndex = this.tabs.index( focusedTab ), goingForward = true; @@ -408,18 +407,6 @@ $.widget( "ui.tabs", { if ( $( this ).is( ".ui-state-disabled" ) ) { event.preventDefault(); } - } ) - - // Support: IE <9 - // Preventing the default action in mousedown doesn't prevent IE - // from focusing the element, so if the anchor gets focused, blur. - // We don't have to worry about focusing the previously focused - // element since clicking on a non-focusable element should focus - // the body anyway. - .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() { - if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { - this.blur(); - } } ); this.tabs = this.tablist.find( "> li:has(a[href])" ) @@ -877,10 +864,7 @@ $.widget( "ui.tabs", { _ajaxSettings: function( anchor, event, eventData ) { var that = this; return { - - // Support: IE <11 only - // Strip any hash that exists to prevent errors with the Ajax request - url: anchor.attr( "href" ).replace( /#.*$/, "" ), + url: anchor.attr( "href" ), beforeSend: function( jqXHR, settings ) { return that._trigger( "beforeLoad", event, $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); diff --git a/ui/widgets/tooltip.js b/ui/widgets/tooltip.js index b626c5d10..d23da1922 100644 --- a/ui/widgets/tooltip.js +++ b/ui/widgets/tooltip.js @@ -227,25 +227,20 @@ $.widget( "ui.tooltip", { content = contentOption.call( target[ 0 ], function( response ) { - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay( function() { - - // Ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } + // Ignore async response if tooltip was closed already + if ( !target.data( "ui-tooltip-open" ) ) { + return; + } - // JQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - } ); + // JQuery creates a special event for focusin when it doesn't + // exist natively. To improve performance, the native event + // object is reused and the type is changed. Therefore, we can't + // rely on the type being correct after the event finished + // bubbling, so we set it back to the previous value. (#8740) + if ( event ) { + event.type = eventType; + } + that._open( event, target, response ); } ); if ( content ) { this._open( event, target, content ); |