use event constructors if possible; use CustomEvent if defined