The final imperative slot distribution API spec has been landed at [1]. There are minor changes from the initial draft [2] which was implemented in Chromium. This feature represents the changes from the draft to the final spec. [1] https://html.spec.whatwg.org/#dom-slot-assign [2] https://chromestatus.com/feature/5711021289242624
This does represent a breaking change to the API shipped in Chromium in M86. However, the usage of this API is exceedingly small [1], at less than 0.000001% of page loads. Additionally, the breakages are mainly around less common use cases, such as explicitly setting the slotAssignment mode to "auto". The other breakage mode is that previously, moving a node out of a shadow host, or moving a slot out of a shadow root, would break the node assignment. Now it will not. This seems unlikely to cause breakage issues. [1] https://chromestatus.com/metrics/feature/timeline/popularity/3442
There is one debuggability issue, which is tracked in [1]. As with the prior (existing) imperative slot API, there is an unobservable "manually assigned nodes" array on each HTMLSlotElement. And with the new proposal, there is also a "manually assigned slot" attached to each Node. It would likely be helpful to be able to see the contents of these properties from devtools. However, this doesn't seem to be critical to launching this feature. https://crbug.com/1199119
--
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/45dfa69b-2da1-4277-9e0a-ab10c40d9a02n%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXHy%3DcEwLyRqL0x%2BUCxuTQfcy1GVjbJ%2B3JNvpKDZ-3B0Up3bg%40mail.gmail.com.
The differences are:
1. Assignments between nodes and slots are more "permanent", and are not removed if either slots or nodes are moved around the tree or among documents. Exceptions will not be thrown from .assign() for slots or nodes "in the wrong spot".
2. The slot assignment mode "auto" has been renamed to "named", to allow additional values to be used later.
3. Repeated nodes in a call to .assign() will now be ordered first-in-first-out order. Previously, assign([a,b,a]) would result in [b,a] ordering. Now, it will result in [a,b] ordering.
4. The parameter(s) to .assign() are now passed in as a variadic list of nodes (e.g. slot.assign(n1,n2,n3)) rather than a single sequence argument (e.g. slot.assign([n1,n2,n2])).
This does represent a breaking change to the API shipped in Chromium in M86. In particular, one of the changes (#4, the sequence-to-variadic change) is a completely breaking change - old calls to slot.assign() will now result in a TypeError being thrown.
However, the usage of this API is exceedingly small [1], at less than 0.000001% of page loads. This API has basically not been publicized at all, not even (it seems) in the release notes for M86. So this change should still be fairly safe.
[1] https://chromestatus.com/metrics/feature/timeline/popularity/3442
----To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDi%3DrDN_CQSHKid8CbSawU8CNPUUKa8VOsLkzw-rxYZvbw%40mail.gmail.com.
LGTM3 and apologies for the delay.