8. A computer program product for executing event handlers specified in a markup language document in a web browser, the computer program product comprising a non-transitory computer-readable storage medium containing the markup language document for being rendered by the web browser application executing on a computer system, the markup language document comprising: a hierarchical structure of nodes representing elements of the markup language document and edges connecting the nodes, the hierarchical structure comprising: a subset of nodes mapped to node types; a mapping from node types to sets of handler functions; and a root node connected with other nodes via paths comprising nodes and edges; and instructions to a web browser application executing on a computer system for executing handlers in response to an event, the instructions for causing the computer system to: receiving a user input associated with a selected node; identifying sets of handlers associated with node types of nodes encountered in a path connecting the root node with the selected node; selecting a set of handlers for execution by determining an intersection of the identified sets of handlers; and executing handlers from the set of handlers selected for execution.
8. A computer program product for executing event handlers specified in a markup language document in a web browser, the computer program product comprising a non-transitory computer-readable storage medium containing the markup language document for being rendered by the web browser application executing on a computer system, the markup language document comprising: a hierarchical structure of nodes representing elements of the markup language document and edges connecting the nodes, the hierarchical structure comprising: a subset of nodes mapped to node types; a mapping from node types to sets of handler functions; and a root node connected with other nodes via paths comprising nodes and edges; and instructions to a web browser application executing on a computer system for executing handlers in response to an event, the instructions for causing the computer system to: receiving a user input associated with a selected node; identifying sets of handlers associated with node types of nodes encountered in a path connecting the root node with the selected node; selecting a set of handlers for execution by determining an intersection of the identified sets of handlers; and executing handlers from the set of handlers selected for execution. 10. The computer program product of claim 8 , wherein the user input is one of a mouse click or a key press operation.