WICG / inert

Polyfill for the inert attribute and property.
Other
922 stars 79 forks source link

Polyfill being applied in Chrome 102 #181

Closed edg2s closed 2 years ago

edg2s commented 2 years ago

Chrome 102, which supports inert, fails the feature detection check, meaning the polyfill is applied unnecessarily:

> Element.prototype.hasOwnProperty('inert')
< false

Changing this to HTMLElement makes the test work correctly:

> HTMLElement.prototype.hasOwnProperty('inert')
< true

Both of the above return false in Chrome 101.

edg2s commented 2 years ago

According to MDN, inert is a property of HTMLElement, not Element: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert

edg2s commented 2 years ago

Could I get a review on this? cc @alice @robdodson

jeffposnick commented 2 years ago

CC: @yoavweiss as well, who made the last commit to this repo.

I can confirm that this is causing the polyfill to be applied on browsers like the latest Safari and Chrome that have built-in support for inert.