more fixes for bug 843004, added pretty output for DOM events