Value of a foreign input element is an attribue
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- web-dev
Línea de trabajo
Comienza ejecutando las dos reproducciones de DOMParser del issue y compara las rutas de análisis de HTML y image/svg+xml para la entrada con foreignObject. Traza cómo la entrada analizada expone su propiedad value frente a su atributo value. La tarea está terminada cuando el caso SVG devuelve el valor inicial mediante my_input.value, coincidiendo con el comportamiento del navegador, con cobertura de regresión para la reproducción.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Dear,
First of all thank for sharing this nice library!
I have an issue when using an html input element as foreign object inside an svg drawing. Not sure if there is anything wrong with this library, or just me doing something not correctly...
BTW if you are wondering why such foreign objects are used, you can here see a demo animation on my wiki to see how it can be used for example for floorplans in home automation.
Case 1: input elements (ok)
I set a default value "Initial" to an input element:
let html = '<html><head></head><body><input id="my_input" value="initial"></body></html>'
let parser = new DOMParser()
let doc = parser.parseFromString(html, 'text/html')
let my_input = doc.querySelector('#my_input')
let value = my_input.value
Both in a browser and using Linkedom the element.value contains that default value:
Case 2: input elements as foreign object in svg (nok)
I set a default value "Initial" to an input element, which is a foreign object inside an svg drawing:
let html = '<svg xmlns="http://www.w3.org/2000/svg"><foreignObject><input id="my_input" value="initial" xmlns="http://www.w3.org/1999/xhtml"></foreignObject></svg>'
let parser = new DOMParser()
let doc = parser.parseFromString(html, 'image/svg+xml')
let my_input = doc.querySelector('#my_input')
let value = my_input.value
When running this in a browser, the element.value still contains that default value (as expected):
However when running this code in Linkedom, the element.value is undefined. And instead the "initial" is stored inside an attribute with name "value":
Hopefully somebody sees what I am doing wrong.
Thanks!!
Bart
- Lenguaje dominante
- HTML
- Estrellas
- 2.1k
- Forks
- 104
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 WebReflection/linkedom
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
WebReflection/linkedom#329 · 5 comentarios ·
-
`el.style.property = ''` and `e.style.setProperty('property', '')` should delete the property Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
WebReflection/linkedom#327 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
WebReflection/linkedom#326 · 5 comentarios ·
-
Build Apps For AI Agent. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
WebReflection/linkedom#321 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebReflection/linkedom#318 · 5 comentarios ·
Todos los issues de WebReflection/linkedom
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
motiondivision/motion#3849 ·
-
area-clientside-dartpad
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Improvement for contact popover Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
needs-triage Platform(Default)
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Support bun dedupe Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
antfu/node-modules-inspector#214 ·