IssueRaiser

Proposal: DOMChangeList

# `DOMChangeList` and `DOMTreeConstruction` ## Motivation There are three high-level motivations for this API: 1. To make it clearer and less error prone to apply a sequence of DOM operations at once, that can support the full gamut of mutations to `Element`s and `Node`s. 2. For efficiency, to provide an API for constructing a sequence of DOM operations that can be: 1. constructed in a worker and transferred to the UI thread 2. constructed with a minimum of allocations 3. applied in one shot without interleaved user code 3. To support, in one API, the superset of trees that can be produced using the HTML parser and using the DOM API (the HTML parser supports more tag names, while the DOM API supports more trees, such as custom elements nested inside a table). > This is an initial, minimal version of this API, which could be expanded over time with more capabilities. It should always maintain its goals of predictable, allocation-lite performance, focusing on giving user-space abstractions the capabilities they need for maximum performance. # Concepts ## NodeToken A `NodeToken` is an opaque value that represents a `Node`. It can be efficiently transferred from one worker to another. It serves two purposes: - To represent a `Node` that already exists in another worker, and can serve as the starting point of a series of mutations expressed in a `DOMChangeList`. - To represent an intermediate `Node` that was produced as part of the process of building a `DOMChangeList

Posted by wycats on Jun 20, 2016, 3:54 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments

ux (Other)

Proposal: DOMChangeList

wycatsJun 20, 2016, 3:54 AM

# `DOMChangeList` and `DOMTreeConstruction` ## Motivation There are three high-level motivations for this API: 1. To make it clearer and less error prone to apply a sequence of DOM operations at once, that can support the full gamut of mutations to `Element`s and `Node`s. 2. For efficiency, to provide an API for constructing a sequence of DOM operations that can be: 1. constructed in a worker and transferred to the UI thread 2. constructed with a minimum of allocations 3. applied in one shot without interleaved user code 3. To support, in one API, the superset of trees that can be produced using the HTML parser and using the DOM API (the HTML parser supports more tag names, while the DOM API supports more trees, such as custom elements nested inside a table). > This is an initial, minimal version of this API, which could be expanded over time with more capabilities. It should always maintain its goals of predictable, allocation-lite performance, focusing on giving user-space abstractions the capabilities they need for maximum performance. # Concepts ## NodeToken A `NodeToken` is an opaque value that represents a `Node`. It can be efficiently transferred from one worker to another. It serves two purposes: - To represent a `Node` that already exists in another worker, and can serve as the starting point of a series of mutations expressed in a `DOMChangeList`. - To represent an intermediate `Node` that was produced as part of the process of building a `DOMChangeList

Comments (0)

No comments yet. Start the discussion.

Comment on this issue