whatwg / whatwg/html

Minor manual slot assignment confusion

Open
#7,679 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: shadow
Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

In the course of reviewing shadow trees and direction I came across some aspects of manual slot assignment that confused me.

DOM defines "assigned nodes" for slots. HTML adds "manually assigned nodes" to this. This already strikes me as slightly weird. Ideally I think we define state of slots in a single place.

Then HTML has two methods assignedNodes() and assignedElements() that directly return "assigned nodes" under certain conditions. This seems fine as assign() does run assign slotables for a tree, but also weird that these two methods don't use "find slottables" which would be equivalent to what they do if you ask for flattened results.

Thoughts?

cc @whatwg/components

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing DOM's definition of assigned nodes with HTML's manually assigned nodes, then read the assignedNodes() and assignedElements() methods alongside assign slotables and find slottables. Clarify whether slot state should be defined in one place and whether the methods should use the same algorithm; the issue is resolved when that specification design has a settled direction.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.