Flat Tree or Composed Tree
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
Línea de trabajo
No files, tests, or entry points are named. Start with the TPAC 2024 meeting notes and the linked shadow-dom-selection examples, then review related issues #169 and #163. Done would require resolving the flat-versus-composed tree questions, including API behavior and discontiguous ranges, rather than making an isolated edit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This surfaced from the conversation at TPAC 2024 about whether we should use a Flat Tree Traversal (Meeting notes) for comparing Selection positions that cross shadow trees.
Composed Tree
With the Composed Tree, we do the normal DOM tree traversal, but consider the owner document to be the common ancestor.
Why this is good:
- Currently, most Selection API uses the Composed Tree, including setStart/setEnd/setBaseAndExtent/isPointInRange. There might be many compat risks to change these APIs.
- Doesn’t require updating Style and Layout. Easier to implement.
Flat Tree
With the Flat Tree, we traverse a flattened tree where the shadow trees are flattened to all be contained within one tree.
Why this is good:
- This is what the user sees when the selection is painted.
- Would take care of re-ordered slotted contents.
- Would make IsPointInRange() and toString() more useful to web users, as what the user sees is what’s selected in the flat tree.
- It avoids the problem of multiple range objects to manage, but looks visually contiguous to the user
Open questions
- Should we change existing Selection APIs to use flat trees? This information can be stored internally and only be accessed by getComposedRanges(), keeping the rest of the behaviors unchanged.
- Else, should we have new APIs which definitely do use Flat Tree?
- Should we support discontiguous ranges?
Examples:
Selection where start and end are in the same tree, but slotted to be in reverse order.
Selection start from the sibling of shadow host, end inside the slotted content.
https://github.com/mfreed7/shadow-dom-selection?tab=readme-ov-file#3-slotted-content
Some use cases
Bidi, tables, flex/grid layout maybe.
Related issues
Need spec changes to Range and StaticRange to support nodes in different tree? #169
Serialization of the current selection, when that selection crosses shadow roots #163
- Lenguaje dominante
- HTML
- Estrellas
- 49
- Forks
- 30
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de w3c/selection-api
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
w3c/selection-api#354 ·
-
Agenda+
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
w3c/selection-api#361 · 2 comentarios ·
-
Remove single range restriction for selection interface apisQuizá libre de nuevo @sambandaru la tomó hace 138 días y no hay ningún pull request abierto. Abierto
w3c/selection-api#358 · 2 comentarios · 1 asignado ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
w3c/selection-api#355 ·
-
the steps of Selection.extend() does not check whether the given offset is valid in the containerAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
w3c/selection-api#353 · 1 comentario ·
Todos los issues de w3c/selection-api
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
jessepollak/home#1627 ·
Los mantenedores suelen responder en 1 día
-
enhancement status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
mastra-ai/mastra#25508 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
canonical/testflinger#1346 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
onedrive: ChangeNotify drops the delta token after one failed poll and stops notifying until remountAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días