Skip to content

Disable DOM domain after each operation.#71

Merged
aslushnikov merged 1 commit intopuppeteer:masterfrom
pavelfeldman:dom_a_2
Jul 11, 2017
Merged

Disable DOM domain after each operation.#71
aslushnikov merged 1 commit intopuppeteer:masterfrom
pavelfeldman:dom_a_2

Conversation

@pavelfeldman
Copy link
Copy Markdown
Contributor

No description provided.

@paulirish
Copy link
Copy Markdown
Contributor

Because I'm curious.. can you explain why this is necessary?

@aslushnikov aslushnikov merged commit afb096c into puppeteer:master Jul 11, 2017
@pavelfeldman
Copy link
Copy Markdown
Contributor Author

DOM domain was made for inspection, not automation. Backend for this domain is stateful and stores information on the nodes it sent to the client. It also pushes all the nodes that are on the path to any nodeId it gives you. And it will also send updates on all the changes to any of those nodes.

In automation, we never want to deal with nodeIds, we need simple backendNodeId handles to nodes. No paths, no state, no updates, nothing. Just a weak handle to a node so that you could perform operations on it. My plan is to migrate as much of the DOM domain methods to backendNodeIds. In this case you would be able to fetch the box model, focus, populate the node, all without enabling the DOM domain and touching nodeId. We might want to do this sooner rather than later...

@aslushnikov
Copy link
Copy Markdown
Contributor

cc @JoelEinbinder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants