You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is unsafe since any code using windows.customElements as a shorthand for detecting support for custom elements will fail prior to loading the actual CE polyfill, since that object doesn't express the CE API. A recent change in shadydom polyfill causes these tests to throw upon loading the shadydom polyfill. Arguably that code could also do a more strict check that both window.customElements && window.customElements.define exist before patching it (which is what the CE polyfill does), but generally seems bad to have a fake object masquerading as a browser API, so choosing to fix it here.
The proper way to force the CE polyfill on is this pattern (the flag only needs to be set if CE exists; if it doesn't exist, the polyfill will be enabled anyway):
Description
A handful of shady-related tests force the CE polyfill on like this:
This is unsafe since any code using
windows.customElements
as a shorthand for detecting support for custom elements will fail prior to loading the actual CE polyfill, since that object doesn't express the CE API. A recent change inshadydom
polyfill causes these tests to throw upon loading the shadydom polyfill. Arguably that code could also do a more strict check that bothwindow.customElements && window.customElements.define
exist before patching it (which is what the CE polyfill does), but generally seems bad to have a fake object masquerading as a browser API, so choosing to fix it here.The proper way to force the CE polyfill on is this pattern (the flag only needs to be set if CE exists; if it doesn't exist, the polyfill will be enabled anyway):
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: