5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 05:04:16 +00:00

editor: arreglar inconsistencia entre navegadores que hace que chrome sea inutilizable

amo que los navegadores funcionen de formas completamente distintas!
Object.values(element.style) da las propiedades seteadas explicitamente
con style="" en firefox, pero en chrome da TODAS las propiedades
posibles, generando un bug y un problema gigante de performance (ya que
esta funcion corre cada vez que pasa cualquier cosa en el editor).
This commit is contained in:
void 2021-01-09 19:18:35 +00:00
parent 61d18f37b4
commit 9cdcaf3cb3

View file

@ -376,16 +376,16 @@ function cleanNode (node, contentEl) {
child.parentElement.removeChild(child)
}
for (const style of Object.values(child.style)) {
const value = child.style[style]
child.style.forEach(prop => {
const value = child.style[prop]
switch (style) {
switch (prop) {
case 'background-color':
if (child.tagName === "MARK") break
if (child.tagName === "MARK") return
default:
child.style[style] = ""
child.style[prop] = ""
}
}
})
}
cleanNode(child, contentEl)
}