From c4e5361e2c8f4a1812cc144ac71e5b988f1ec983 Mon Sep 17 00:00:00 2001 From: Material Web Team Date: Mon, 21 Oct 2024 10:28:45 -0700 Subject: [PATCH] chore: remove IE support. IE usage is <0.5%. PiperOrigin-RevId: 688186161 --- packages/mdc-slider/test/component.test.ts | 7 +--- packages/mdc-tooltip/test/component.test.ts | 40 --------------------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/packages/mdc-slider/test/component.test.ts b/packages/mdc-slider/test/component.test.ts index 0f4c8d0e926..088f5fb9052 100644 --- a/packages/mdc-slider/test/component.test.ts +++ b/packages/mdc-slider/test/component.test.ts @@ -708,12 +708,7 @@ function createEventFrom( if (phase !== 'down') { type = phase === 'move' ? 'pointermove' : 'pointerup'; } - // PointerEvent constructor is not supported in IE. Use a MouseEvent in - // IE, since PointerEvent inherits from MouseEvent. - const isIe = navigator.userAgent.indexOf('MSIE') !== -1 || - navigator.userAgent.indexOf('Trident') !== -1; - event = isIe ? createMouseEvent(type, {clientX}) : - new PointerEvent(type, {clientX, pointerId: 1}); + event = new PointerEvent(type, {clientX, pointerId: 1}); break; case 'mouse': type = 'mousedown'; diff --git a/packages/mdc-tooltip/test/component.test.ts b/packages/mdc-tooltip/test/component.test.ts index 106502ea1cd..be51eb57957 100644 --- a/packages/mdc-tooltip/test/component.test.ts +++ b/packages/mdc-tooltip/test/component.test.ts @@ -38,11 +38,6 @@ function setupTestWithMockFoundation(fixture: HTMLElement) { return {anchorElem, tooltipElem, mockFoundation, component}; } -function isIE() { - return navigator.userAgent.indexOf('MSIE') !== -1 || - navigator.userAgent.indexOf('Trident') !== -1; -} - describe('MDCTooltip', () => { let fixture: HTMLElement; setUpMdcTestEnvironment(); @@ -383,11 +378,6 @@ describe('MDCTooltip', () => { it('aria-expanded becomes false on anchor when anchor blurs and non-tooltip element is focused', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[data-tooltip-id]')!; @@ -404,11 +394,6 @@ describe('MDCTooltip', () => { it('aria-expanded remains true on anchor when anchor blurs and rich tooltip focuses', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[data-tooltip-id]')!; @@ -425,11 +410,6 @@ describe('MDCTooltip', () => { it('aria-expanded becomes false on anchor when rich tooltip focuses out and anchor does not receive focus', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[data-tooltip-id]')!; @@ -446,11 +426,6 @@ describe('MDCTooltip', () => { it('aria-expanded remains true on anchor when rich tooltip focuses out and anchor receives focus', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[data-tooltip-id]')!; @@ -467,11 +442,6 @@ describe('MDCTooltip', () => { it('aria-expanded remains true on anchor when rich tooltip focuses out and element within tooltip receives focus', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const tooltipContent = fixture.querySelector('.mdc-tooltip__content')!; @@ -636,11 +606,6 @@ describe('MDCTooltip', () => { it('aria-hidden becomes true on tooltip when anchor blurs and non-tooltip element is focused', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[aria-describedby]')!; @@ -657,11 +622,6 @@ describe('MDCTooltip', () => { it('aria-hidden remains false on tooltip when anchor blurs and rich tooltip focuses', () => { - // FocusEvent is not supported on IE11 so this test will not be run on - // it. - if (isIE()) { - return; - } const tooltipElem = fixture.querySelector('#tt0')!; const anchorElem = fixture.querySelector('[aria-describedby]')!;