Skip to content

Commit

Permalink
chore: remove IE support. IE usage is <0.5%.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 688186161
  • Loading branch information
material-web-copybara authored and copybara-github committed Oct 21, 2024
1 parent 810e22d commit c4e5361
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
7 changes: 1 addition & 6 deletions packages/mdc-slider/test/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
40 changes: 0 additions & 40 deletions packages/mdc-tooltip/test/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[data-tooltip-id]')!;
Expand All @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[data-tooltip-id]')!;
Expand All @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[data-tooltip-id]')!;
Expand All @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[data-tooltip-id]')!;
Expand All @@ -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<HTMLElement>('#tt0')!;
const tooltipContent =
fixture.querySelector<HTMLElement>('.mdc-tooltip__content')!;
Expand Down Expand Up @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[aria-describedby]')!;
Expand All @@ -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<HTMLElement>('#tt0')!;
const anchorElem =
fixture.querySelector<HTMLElement>('[aria-describedby]')!;
Expand Down

0 comments on commit c4e5361

Please sign in to comment.