Add Selection/Range methods based on anchestor element
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- html
- Área
- web-dev
Línea de trabajo
Start by reading the suggested Selection and Window IDL interfaces and the requirements for contextElement, character offsets, and innerText-style line breaks. Determine the intended API behavior, error cases, and AddRange integration before implementation; done requires an agreed specification and corresponding tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Add function prototypes for getting/setting anchorNode/anchorOffset and focusNode/focusOffset as character offsets based on a given anchestor node.
The suggested functionality is necessary to track and regain a selection in an editing host when DOM manipulation takes place.
Suggested IDL Interfaces
partial interface Selection {
[Throws]
Range? getRangeAt(unsigned long index, Element contextElement);
};
partial interface Window {
[Throws] Selection? getSelection(Element contextElement);
};
Details
1.
const selObj = window.getSelection(contextElement: HTMLElement);
Should yield:
selObj.anchorNode === selObj.focusNode === contextElement;
selObj.anchorOffset = AnchorCharacterOffsetFromContextElement(contextElement);
selObj.focusOffset = FocusCharacterOffsetFromContextElement(contextElement);
2.
const rngObj = window.getSelection().getRangeAt(index: number, contextElement: HTMLElement);
Should yield:
rngObj.commonAncestorContainer === rngObj.startContainer === rngObj.endContainer === contextElement;
rngObj.startOffset = AnchorCharacterOffsetFromContextElement(contextElement);
rngObj.endOffset = FocusCharacterOffsetFromContextElement(contextElement);
Both suggested functions are supposed to either throw an ReferenceError or yield void 0 when contextElement is not an anchestor of both, selObj.anchorNode/selObj.focusNode and rngObj.startOffset/rngObj.endOffset, resp.
selObj.AddRange() should take above Range object, recognize that it is based on a context element and put the cursor selection according to the character offsets given in a Range object; based on contextElement.
Character count should mimic the behaviour of the Element.innerText property, i.e. considering <br/> elements, <p> elements and block elements following inline elements as new-line characters (= \n).
- 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 2/5 1-3 horas Aptitud para principiantes 88/100
openedx/frontend-app-authoring#3274 ·
Los mantenedores suelen responder en 1 día
-
Unconfirmed bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
luanti-org/luanti#17605 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/fluentui-blazor#5364 ·
Los mantenedores suelen responder en 1 día
-
COLEAD websiteAbiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
wagtail/madewithwagtail#236 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Design only Leadership Survey SLFS
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
bcgov/digital-journeys#2293 ·