IP Library Granted Patent US 8,307,277
Granted Patent B2
US 8,307,277 · App. 12/879,788 · Granted Nov 6, 2012

Efficient event delegation in browser scripts

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,307,277
App. No.
12/879,788
Granted
Nov 6, 2012
Kind
B2
Abstract

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.

Claims (40)

1. A computer implemented method comprising:

receiving a markup language document specifying a user interface for interacting with a user;

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;

a mapping from node types to sets of handler functions; and

a root node connected with other nodes via paths comprising nodes and edges;

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.

2. The computer implemented method of claim 1 , wherein selecting the set of handlers for execution comprises:

determining a number of the sets of handlers encountered in the path;

determining a count of number of times each handler is encountered in the path; and

identifying a handler for execution if the count of the handler matches the number of sets of handlers.

3. The computer implemented method of claim 1 , wherein the hierarchical structure further comprises:

metadata associated with nodes, wherein the metadata distinguishes instances of nodes belonging to a same node type.

4. The computer implemented method of claim 1 , wherein the user input is one of a mouse click or a key press operation.

5. The computer implemented method of claim 1 , wherein the selected node is displayed in the browser as one of a link, button, or image.

6. The computer implemented method of claim 1 , wherein the hierarchical representation of nodes is a document object model (DOM) tree.

7. The computer implemented method of claim 1 , wherein the handler functions are specified in a scripting language.

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.

9. The computer program product of claim 8 , wherein the hierarchical structure further comprises:

metadata associated with nodes, wherein the metadata distinguishes instances of nodes belonging to a same node type.

10. The computer program product of claim 8 , wherein the user input is one of a mouse click or a key press operation.

11. The computer program product of claim 8 , wherein the selected node is displayed in the browser as one of a link, button, or image.

12. The computer program product of claim 8 , wherein the hierarchical representation of nodes is a document object model (DOM) tree.

13. The computer program product of claim 8 , wherein the handler functions are specified in a scripting language.

14. The computer program product of claim 8 , wherein selecting the set of handlers for execution comprises:

determining a number of the sets of handlers encountered in the path;

determining a count of number of times each handler is encountered in the path; and

identifying a handler for execution if the count of the handler matches the number of sets of handlers.

Assignments (2)
CHANGE OF NAME Recorded Nov 18, 2021
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 058897/0824 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 6, 2011
From: PRIESTLEY, EVAN; BHARAMBE, ASHWIN
To: FACEBOOK, INC.
Reel/Frame 025595/0978 →