Intent to Implement: customElements.upgrade()

75 views
Skip to first unread message

TAMURA, Kent

unread,
Apr 3, 2018, 12:03:43 AM4/3/18
to blink-dev

Contact emails

tk...@chromium.org


Explainer

N/A


Design doc/Spec

https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade


Summary

Add "upgrade()" method to CustomElementRegistry interface, i.e. window.customElements instance.


Motivation

Custom elements in disconnected trees may not be upgraded to author-defined classes until they are connected. It's helpful if authors can upgrade such elements explicitly and elements work as author's expectation even in disconnected trees.


Risks

Interoperability and Compatibility

Risk is low. This is a very small addition to CustomElementRegistry interface, and Apple proposed this feature, and no objection in WebCompnents F2F meeting.


Edge: Not opposed

Firefox: Not opposed

Safari: Public support

Web developers: Positive


Ergonomics

N/A


Activation

Polyfill would help.

It's difficult to make polyfill only for this method on top of native implementation of Custom Elements. Polyfill for the whole Custom Elements should have this method.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Is this feature fully tested by web-platform-tests?

Yes.

http://w3c-test.org/custom-elements/custom-element-registry/upgrade.html

Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5967337471606784


Requesting approval to ship?

Yes.


--
TAMURA Kent
Software Engineer, Google





TAMURA, Kent

unread,
Apr 3, 2018, 12:06:50 AM4/3/18
to blink-dev
Oops, the subject was not correct!

Chris Harrelson

unread,
Apr 3, 2018, 12:10:32 AM4/3/18
to TAMURA, Kent, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqFOv6zHRsVX-MvQTcv%2BfOnDf6ostq3V8ex1NhW4JRwR6w%40mail.gmail.com.

Philip Jägenstedt

unread,
Apr 4, 2018, 7:58:25 AM4/4/18
to Chris Harrelson, TAMURA, Kent, blink-dev
LGTM2

Sounds like this ought to be trivial to implement for everyone and non-controversial, so little interop risk. I guess that http://w3c-test.org/custom-elements/custom-element-registry/upgrade.html was written without any implementation, hope the tests work :)

sligh...@chromium.org

unread,
Apr 5, 2018, 11:17:57 AM4/5/18
to blink-dev, chri...@chromium.org, tk...@chromium.org
LGTM3
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages