Add shadowrootslotassignment attribute#12267
Conversation
|
/cc @mfreed7 |
|
It seems that we also need a mechanism to specify which nodes are assigned in what order. |
Right. I think that it would be possible to ship the two independently, right? It's possible today to create a manual assignment shadowroot and never assign nodes. |
Maybe? It seems like we want some kind of plan for it before we this feature though. |
annevk
left a comment
There was a problem hiding this comment.
You also need to add the IDL attribute for the template element.
This looks great to me! I could finally address this 4 year old Chromium TODO.
+1 - I think this PR provides perfect parity to the imperative |
AIUI the design described in WICG/webcomponents#967 adds a new attribute to slot elements. To me this stands to reason that these become opt-in, and therefore the design is additive - which is to say if we go with the proposed solution there, I believe they can ship independently. So I don't think landing this now would close off the design space for us; landing this will not preclude us from the design in WICG/webcomponents#967, and I suspect it doesn't close off any other potential solutions in a way which would still make sense, but I'd be happy to be corrected on this. |
|
I believe I've completed all the necessary steps for this to be merged, so all that's left is an editorial review. Please let me know if there's anything more to do here. Thanks! |
annevk
left a comment
There was a problem hiding this comment.
If you contrast this with https://dom.spec.whatwg.org/#interface-shadowroot you see that slot assignment comes before clonable. I suggest we try to stick to that order.
|
I also noticed that the order is probably not tested as I changed the order in my implementation and still passed all the tests. (There is a test for it somewhere for the other attributes.) |
annevk
left a comment
There was a problem hiding this comment.
Looks good modulo final formatting issue.
| <code data-x="attr-template-shadowrootclonable">shadowrootclonable</code>; | ||
| <code data-x="attr-template-shadowrootserializable">shadowrootserializable</code>; | ||
| <code data-x="attr-template-shadowrootcustomelementregistry">shadowrootcustomelementregistry</code></td> | ||
| <code data-x="attr-template-shadowrootslotassignment">shadowrootslotassignment</code>; |
There was a problem hiding this comment.
The indentation seems wrong here. They all got an additional leading space?
we hardly knew ye
This brings up to date with the specification for declarative shadow roots: whatwg/html#12267. The `shadowrootslotassignment` attribute on `<template>` elements specifies the slot assignment mode used by the declarative shadow root created by the template. Testing: New tests start to pass --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This brings up to date with the specification for declarative shadow roots: whatwg/html#12267. The `shadowrootslotassignment` attribute on `<template>` elements specifies the slot assignment mode used by the declarative shadow root created by the template. Testing: New tests start to pass --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This brings up to date with the specification for declarative shadow roots: whatwg/html#12267. The `shadowrootslotassignment` attribute on `<template>` elements specifies the slot assignment mode used by the declarative shadow root created by the template. Testing: New tests start to pass --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This brings up to date with the specification for declarative shadow roots: whatwg/html#12267. The `shadowrootslotassignment` attribute on `<template>` elements specifies the slot assignment mode used by the declarative shadow root created by the template. Testing: New tests start to pass --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Implements the
shadowrootslotassignmentattribute.Refs WICG/webcomponents#967
shadowrootslotassignment=attribute WebKit/standards-positions#631(See WHATWG Working Mode: Changes for more details.)
/indices.html ( diff )
/parsing.html ( diff )
/scripting.html ( diff )