发明名称 Efficient event delegation in browser scripts
摘要 Event handlers associated with markup language documents represented in a web browser are identified efficiently in response to an event. The markup language document is represented as a hierarchical structure comprising nodes and edges. Nodes are associated with node types, each node type defining how descendants of the node respond to events. The markup language document provides mappings of sets of node types to sets of handlers. In response to an event associated with a node, the types of nodes encountered in a path connecting the node with the root node are identified. Handler sets of the node types encountered in the path connecting a node with the root node are used to determine the handlers to be executed in response to the event. Data is associated with nodes to allow handler code to distinguish between nodes of the same node type.
申请公布号 US9003278(B2) 申请公布日期 2015.04.07
申请号 US201213615151 申请日期 2012.09.13
申请人 Facebook, Inc. 发明人 Priestley Evan;Bharambe Ashwin
分类号 G06F17/00;G06F9/54 主分类号 G06F17/00
代理机构 Fenwick & West LLP 代理人 Fenwick & West LLP
主权项 1. A computer implemented method comprising: receiving a markup language document specifying a user interface for interacting with a user; receiving 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; representing the markup language document using a hierarchical structure of nodes representing elements of the markup language document and edges connecting the nodes, wherein the hierarchical structure comprises: a subset of nodes mapped to node types; and a root node connected with other nodes via paths comprising nodes and edges; receiving a user input associated with a selected node; identifying a set of node types encountered in a path connecting the root node with the selected node; identifying a set of handlers mapped to the identified set of node types based on the mapping; and executing the handlers in the identified set of handlers.
地址 Menlo Park CA US