Support delegated DOM event handling
Created by: Zapotek
Have elements inherit their ancestors' DOM events when building the list in DOMMonitor#elements_with_events
, in order to cover cases where events of child nodes are handled by an ancestor.
This will create a lot more workload which will yield no results most of the time, so consider the following optimizations:
- Disable this feature when jQuery is detected and use the existing special jQuery handling for these cases.
- Add custom handling for more libraries if possible (AngularJS without jQuery, ReactJS).
- Only enable event inheriting for interesting elements (links, buttons, inputs, etc.) instead of everything.