polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

ShadyDOM polyfill incompatible when MooTools loaded in IE 11

Open petermikitsh opened this issue 4 years ago • 1 comments

Description

If you load a "compat" version of MooTools on a webpage, ShadyDOM will throw exceptions in these locations:

https://github.com/webcomponents/polyfills/blob/c6021490e0fa172dc389de2e806b83ef0ffb11bf/packages/shadydom/src/patches/Node.js#L200

https://github.com/webcomponents/polyfills/blob/c6021490e0fa172dc389de2e806b83ef0ffb11bf/packages/shadydom/src/patches/Node.js#L207

This is because MooTools mutates Document in a way that breaks instanceof checks.

Example

Visit the example in Internet Explorer 11 to see the runtime exceptions:

https://petermikitsh.github.io/cheatsheets-web/?path=/story/demos--web-components-moo-tools-ie-11

Source code: https://github.com/petermikitsh/cheatsheets-web/blob/b6ef632ba45631e5a04bf0ed30860b190eb0ca88/static/WebComponentsIE11.html#L1

Steps to reproduce

  1. Load a "compat" version of MooTools
  2. Add the webcomponents polyfills
  3. Use a web component and see the exception

Invalid operand to 'instanceof': Function expected

Screen Shot 2021-05-23 at 2 07 48 PM

Expected behavior

No runtime exception: the correct webpage looks like this (shown in Chrome for example purposes):

Screen Shot 2021-05-23 at 2 10 27 PM

Actual behavior

Runtime exception

Version

Latest

Browsers affected

  • [ ] Chrome
  • [ ] Firefox
  • [ ] Edge
  • [ ] Safari
  • [x] IE 11 (tested in Windows 7)

petermikitsh avatar May 23 '21 21:05 petermikitsh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 11 '22 03:06 stale[bot]