Intent to Deprecate: ShadowRoot.getElementsBy*()

93 views
Skip to first unread message

Philip Jägenstedt

unread,
Dec 12, 2014, 3:10:12 PM12/12/14
to blink-dev

Primary eng (and PM) emails

phi...@opera.com


Summary

Deprecate getElementsByClassName(), getElementsByTagName() and getElementsByTagNameNS() on ShadowRoot.


Note: getElementById() is not involved in any way.


Motivation

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23620


Follow the links for more context. In summary, this was agreed upon a year ago, and it came up again when I suggested moving these functions to ParentNode, the common interface of Document, DocumentFragment and Element. That probably won't happen, but the fate of these on ShadowRoot is a mostly separate concern.


The spec is http://w3c.github.io/webcomponents/spec/shadow/#idl-def-ShadowRoot and I trust Dimitri or Hayato will update it some time before these are eventually removed, if that's the outcome.


Compatibility Risk

Any content using these methods will throw exceptions.


Alternative implementation suggestion for web developers

getElementsByClassName('foo') becomes querySelectorAll('.foo')

getElementsByTagName('foo') becomes querySelectorAll('foo')

getElementsByTagNameNS(...) becomes querySelectorAll('...|...')


Usage information from UseCounter

There are none. I suggest adding the use counters with DeprecateAs= directly because usage is likely low enough to not amount to console spam and this saves a release cycle of waiting.


Entry on chromestatus.com, crbug.com, or MDN

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


Requesting approval to remove too?

No, wait until the deprecation and thus the use counters have reached stable and evaluate the compat risk at that time.

Dimitri Glazkov

unread,
Dec 12, 2014, 4:26:43 PM12/12/14
to Philip Jägenstedt, blink-dev
LGTM.

Chris Harrelson

unread,
Dec 12, 2014, 8:17:20 PM12/12/14
to Dimitri Glazkov, Philip Jägenstedt, blink-dev
LGTM

LGTM.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Hayato Ito

unread,
Dec 13, 2014, 4:36:40 AM12/13/14
to Chris Harrelson, Dimitri Glazkov, Philip Jägenstedt, blink-dev
Non-API-owner LGTM.

l'll remove it from the Shadow DOM spec. We can assume that these are removed from the spec in a few days.
I'll add use counter for these APIs if we get enough LGTM here.

Philip Jägenstedt

unread,
Dec 13, 2014, 4:53:32 AM12/13/14
to Hayato Ito, blink-dev, Dimitri Glazkov, Chris Harrelson

Hayato, if you want to take care of the use counters and deprecation, please go ahead. Deprecation does not require LGTMs, but here's a third one: LGTM.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages