Define `Selection.rangeCount` when an input field is focused
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- html
- Área
- web-dev
Línea de trabajo
Start with the two reduced HTML/JavaScript test cases in issue #166 and compare their rangeCount results when focus moves into an input. Read the related Selection API issue #83 and the reported browser behavior; done means the specification clearly defines the expected rangeCount behavior and captures the relevant cases.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello!
In the process of investigating a web compat issue in WebKit that affects Quip's editor, I stumbled into the fact that Selection.rangeCount behaves differently across FF, Chrome and Safari when the selection is moved into a text field.
Consider the following reduced test case:
<input />
<script>
document.querySelector("input").focus();
document.write(`rangeCount := ${getSelection().rangeCount}`);
</script>
Safari 16 and Chrome will show a rangeCount of 1. However, Safari 17 (with Live Range Selection enabled, at time of writing) and Firefox both show a rangeCount of 0. However, if I adjust the test case to additionally set the DOM selection prior to focusing the input:
<input />
<script>
getSelection().setPosition(document.body, 0);
document.querySelector("input").focus();
document.write(`rangeCount := ${getSelection().rangeCount}`);
</script>
...then Firefox outputs 1 instead of 0. The behavior in Firefox seems to be that moving focus into an input field doesn't affect selection ranges, whereas behavior in Safari 16 and Chrome is that the selection will move to the start of the containing shadow host (in this case, the input element). In Safari 17, with Live Range Selection enabled, we'll now expose a rangeCount of 0 after moving focus into a text field.
Edit: this is essentially a small piece of https://github.com/w3c/selection-api/issues/83, that's just about the rangeCount.
- 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 137 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 2/5 1-3 horas Aptitud para principiantes 88/100
angular/angularfire#3774 ·
Los mantenedores suelen responder en 2 días
-
ux
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
rr-djk/rr-djuikoo.com#53 ·
Los mantenedores suelen responder en 1 día
-
订阅管理中单个订阅源配置菜单溢出Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
joeseesun/qiaomu-ai-rss#54 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
digitalgroundgame/pragmatic-papers#1035 ·
Los mantenedores suelen responder en 1 día
-
app bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día