Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Selection.modify() taking optional strings doesn't make sense to me

Abierto
#346 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
html
Área
api, web-dev

Línea de trabajo

Start with the Selection.modify() definition in the linked Selection API specification and compare the optional-argument behavior described there with the WebKit, Blink, and Gecko behavior noted in the issue. Determine whether the specification should require arguments or clarify the silent-abort behavior; the work is done when the issue's proposed resolution is reflected in the specification.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

https://w3c.github.io/selection-api/#dom-selection-modify says:

undefined modify(optional DOMString alter, optional DOMString direction, optional DOMString granularity);

However it also says:

If alter is not ASCII case-insensitive match with "extend" or "move", abort these steps.
If direction is not ASCII case-insensitive match with "forward", "backward", "left", or "right", abort these steps.
If granularity is not ASCII case-insensitive match with "character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphboundary", "documentboundary", abort these steps.

So, basically, it early returns without errors if any of the arguments don't match. That doesn't make a lot of sense to me.

That seems to match WebKit and Blink's implementation. Gecko however throws a reasonable error and makes the strings mandatory.

I think the Gecko behavior is preferable, but if we're going with the "silent error" behavior of WebKit / Blink, maybe we should clarify it as a compatibility quirk (since it's really odd).

cc @rniwa @smaug---- @foolip

Lenguaje dominante
HTML
Estrellas
49
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de w3c/selection-api

Todos los issues de w3c/selection-api

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.