EventHandler has many duplicated code and long functions. This entire class needs to be refactored and cleaned up.
If we are going to undertake cleaning up EventHandler, which is an extremely laudable goal and needs to be done, we should consider making some changes to its design as well. For instance, does it really need to be per-frame, or can we make it per Page?
(In reply to comment #1) > If we are going to undertake cleaning up EventHandler, which is an extremely laudable goal and needs to be done, we should consider making some changes to its design as well. For instance, does it really need to be per-frame, or can we make it per Page? It does store some states so we'll be changing the behavior if we're moving it to Page-level. I guess we'll need to investigate per feature basis. It might even be that we need two separate classes for Page-level and Frame-level states.
Some of the bits from EventHandler should be moved to EventDispatcher, which is being birthed in bug 57168.