19. The non-transitory computer readable storage medium of claim 13 , wherein the hierarchical representation of nodes is a document object model (DOM) tree.
13. A non-transitory computer-readable storage medium containing one or more markup language documents for being rendered by a web browser application executing on a computer system, the one or more markup language documents comprising: a hierarchical structure of nodes representing elements of a markup language document and edges connecting the nodes, wherein: a subset of nodes mapped to node types and a root node connected with other nodes via paths comprising nodes and edges; and a specification comprising a mapping from sets of node types to sets of handlers, wherein each set of node types specified in the mapping is mapped to a set of handlers; 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: receive a user input associated with a selected node; identify a set of node types encountered in a path connecting the root node with the selected node; identify a set of handlers mapped to the identified set of node types based on the mapping; and execute the handlers in the identified set of handlers.