-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌸 Cherry-pick request into #25222 (Approved) #25258
Comments
I am the release engineer this week. Let me know when this is ready. |
PR is already merged, we just need cherry-pick approval. |
Approved |
Approved |
Cherry-pick to canary and RC completed. Assign back to @jridgewell for postmortem |
Postmortem published, closing. |
@jridgewell Is there a regression test we can add or opt-in for IE for CE registration? |
Integration tests would be all that's necessary, if we enabled them. |
Yea, enabling something trivial on IE (e.g. single |
Cherry-pick request
Why does this issue meet the cherry-pick criteria?
All AMP pages are broken in IE 11 due to a bug in the Custom Elements polyfill.
Mini-postmortem
Summary
The new Custom Elements v1 polyfill contained a bug that prevented creating custom element instances in IE 11.
Root Causes
Custom Elements must extend from the
HTMLElement
class (required by the CE spec). The new polyfill injected a brand new functionHTMLElementPolyfill
as a subclass ofHTMLElement
, and overwritewindow.HTMLElement = HTMLElementPolyfill
. With proper subclasses, the prototype of both the Class' constructor function and the associated prototype must point to the superclass. Meaning,HTMLElementPolyfill.__proto__ === HTMLElement
andHTMLElementPolyfill.prototype.__proto__ === HTMLElement.prototype
. This is how subclassing works in ES6 browsers.When you transpile a subclass, generally, you must have the equivalent of a
super()
call in the subclass constructor. This is usually compiled tosuperClass.call(this)
as the ES5 way of doing subclass construction.In IE11,
HTMLElement
is an exotic host object, and does not extend from theFunction
class. Because it doesn't extend fromFunction
,HTMLElement.call
does not exist (it's defined onFunction
class). So, when we transpiledsuper()
toHTMLElement.call(this)
, we got an error.Action Items
crossorigin=anonymous
Lessons Learned
crossorigin=anonymous
on the scriptsThings that went well
Things that went wrong
/cc @ampproject/wg-approvers @ampproject/cherry-pick-approvers
The text was updated successfully, but these errors were encountered: