Skip to content

[🐛 Bug]: Arrow functions and .contains() crash IE11 via isElementDisplayed() #11711

@colinrotherham

Description

@colinrotherham

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.23.4

Node.js Version

20.9.0

Mode

Standalone Mode

Which capabilities are you using?

{
  browserName: 'internet explorer',
  browserVersion: '11.285',
  platformName: 'Windows 10'
}

What happened?

Following on from #11705 I've got a few more IE11 issues

TypeScript uses "target": "es2022" for ./packages/webdriverio/src/scripts so these aren't downleveled

Arrow functions

Internet Explorer 11 has no arrow function support

// If the container's overflow is not hidden and it has zero size, consider the
// container to have non-zero dimensions if a child node has non-zero dimensions.
return Array.from(element.childNodes).some((childNode: Element) => {

Method .contains()

Internet Explorer 11 has .contains() support only for HTMLElement (not Document or other node types)

// This is a partial reimplementation of Selenium's "element is displayed" algorithm.
// When the W3C specification's algorithm stabilizes, we should implement that.
// If this command is misdirected to the wrong document (and is NOT inside a shadow root), treat it as not shown.
if (!isElementInsideShadowRoot(element) && !document.contains(element)) {

What is your expected behavior?

WebdriverIO v8 should still support IE11

How to reproduce the bug.

See #11705 for the same steps to reproduce

Relevant log output

See https://github.com/webdriverio/webdriverio/issues/11705 for log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions