Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add adoptedCallback to work around Firefox Native CE bug (#34455)
See https://output.jsbin.com/yuwojok/29/quiet for a working demo of the bug. When we construct a CustomElement in one document, then insert it into another document (as we do with A4A ads), Firefox incorrectly resets the prototype of our CE instance to `HTMLElement.prototype`. Luckily, we can fix this by listening for the `adoptedCallback`, which fires just after Firefox resets the prototype. If we detect a broken prototype chain, we can correct it before any other code can notice. See https://output.jsbin.com/datajos/5/quiet for a demo of the fix.
- Loading branch information