-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize the slots proposal #128
Comments
The proposal looks good to me at first glance. I'll take another look later. Quick question:
What is the motivation for making this list? Do we expose the new API to access the result of the slotting algorithm? |
Hmm, is there a reason we can't use this list to trigger an imperative distribution API? |
Interoperability. A precisely defined list ensures that we don't have to hunt down subtle bugs across multiple implementations.
Sadly, no. The synchronous action is mostly a spec construct to precisely describe the cause and effect. It is unlikely that browser implementations will even use the exact algorithm for implementations. |
I see, however, this list might not be enough for interoperability. What we need is a list which will trigger the distribution resolution algorithm, I think. Most of exposed states depends on the result of distribution resolution algorithm, rather than the result of the slotting algorithm. At first glance, a list which will trigger the distribution resolution might be a strict super set of a list which will trigger the slotting algorithm. Let me take another look later. |
Now I can feel that I understand the intention of the new proposal. I'll remove the current See #130 also. |
In the proposal,
I'm afraid that this is imcomplete because each node is assigned to at-most one slot in the proposal. |
Yep, you're right. In the slot world, there will be only one node in that list, so it doesn't need to be a list. |
Yeah. Instead of the current partial interface Node {
[nullable] Element assignedSlot; // a tentative name
} I haven't decided whether |
Given the entirely-local nature of distribution in the slots world, assignedSlot should return the directly assigned slot. The fact that that slot happened to be distributed into another slot is not relevant. |
Yeah, but we should be aware that main use case of If we provide only function slotWhereNodeIsRendered(node) {
var slot = node.assignedSlot;
while (slot.assignedSlot) {
slot = slot.assignedSlot;
}
return slot;
} This takes O(N), but I'm sure that the platform can return the same result in O(1), though it depends on the implementation of user-agent. I guess the performance doesn't matter here. N might be small enough in most cases. Providing only |
Yeah, if it's actually common for developers to write utility methods for the composed tree, we can consider adding them. Let's just make v1 the minimum viable thing. |
Let me close this bug since I've finished the spec-ing of slots. I hope I can say that the current spec has the processing equivalence to the proposal. Please feel free re-open this bug (or file a new bug) if we are to address some of the task list. |
The proposal is here: https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Slots-Proposal.md
Task list:
The text was updated successfully, but these errors were encountered: