Intent to Implement and Ship: assignedElements on <slot>

69 views
Skip to first unread message

Rakina Zata Amni

unread,
Jan 2, 2018, 9:01:48 AM1/2/18
to blink-dev

Contact emails

rak...@chromium.org


Spec

https://html.spec.whatwg.org/#dom-slot-assignedelements


Discussion & WPT:


Summary

Add assignedElements on <slot>, similar to assignedNodes(), but returning Element nodes only. The method returns elements that are assigned to a given slot.


Motivation

Sometimes web developers need to know how many elements are provided by the user (for example, in a custom element with a Shadow DOM creating a slideshow, they need to know how many slides are provided to be able to generate the same number of pagination items). The currently available method assignedNodes returns all nodes, including empty text nodes, not just element nodes, which are usually not useful for web developers.


Risks

Interoperability and Compatibility

Low. Chrome would be the first browser to support this feature.


Edge: In development (assigned) https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/15125746/

Firefox: In development (assigned) https://bugzilla.mozilla.org/show_bug.cgi?id=1425685

Safari: No signals https://bugs.webkit.org/show_bug.cgi?id=174313

Web developers: Positive in wanting this feature as seen on https://github.com/w3c/webcomponents/issues/602


Interoperability tests:


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?

https://github.com/w3c/web-platform-tests/pull/8636


Link to entry on the feature dashboard

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


Requesting approval to ship?

Yes


Notes

CL: https://crrev.com/c/842522

Chris Harrelson

unread,
Jan 3, 2018, 7:37:49 PM1/3/18
to Rakina Zata Amni, 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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACPC1r70tXpwVnEuz%2BGTQ6_X0jwNLadGzb0%2BUF0jqGbPZzmA4w%40mail.gmail.com.

Daniel Bratell

unread,
Jan 4, 2018, 9:30:41 AM1/4/18
to Rakina Zata Amni, Chris Harrelson, blink-dev
LGTM2

/Daniel
LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
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/CAOMQ%2Bw-aPUeSthZ49uvHUYb7%3DUVMxCnY_0F0grVfC8wbuqEo_w%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Yoav Weiss

unread,
Jan 4, 2018, 4:12:18 PM1/4/18
to Daniel Bratell, Rakina Zata Amni, Chris Harrelson, blink-dev
Reply all
Reply to author
Forward
0 new messages