elm / virtual-dom

The foundation of HTML and SVG in Elm.
https://package.elm-lang.org/packages/elm/virtual-dom/latest
BSD 3-Clause "New" or "Revised" License
209 stars 80 forks source link

VirtualDom_virtualize causes flashes on <img> #144

Open ktosiek opened 5 years ago

ktosiek commented 5 years ago

When virtualizing an <img>, the src attribute is interpreted as an attribute. But Html.Attributes.src is a property.

This inconsistency confuses _VirtualDom_diffFacts, which generates a patch to delete the attribute and add the property, resulting in a visible flick on Firefox 62 (with developer tools closed). Chrome 69 seems to handle it fine, and I don't have a different browser to test on handy.

Would a patch adding an attribute -> property mapping to virtualize, at least for the properties available in Html.Attributes, make sense?