Bug 1607560 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

So we actually have to implement an [element store similar to the one from Marionette](https://searchfox.org/mozilla-central/rev/c52d5f8025b5c9b2b4487159419ac9012762c40c/testing/marionette/element.js#97). With that we have our own mirror of DOM nodes as present in the various targets. Once an element is requested it needs to be added to that store, and at the same time it will get a unique id. Given that we don't have to diverge between the front-end and backend it looks like that `nodeId` and `backgroundNodeId` can be the same.

As temporary solution (which even makes some Puppeteer tests pass) I simply return the node's data. And by that I got nearly all of the available properties filled with data:

```
puppeteer:protocol SEND ► {"sessionId":1,"method":"DOM.describeNode","params":{"objectId":"0b2954a7-6584-7a49-88f6-08d4e221540d"},"id":19} +1ms
1579269043591	RemoteAgent	TRACE	(connection {7878ad7a-a940-d044-87c1-376576d4d852})-> {"sessionId":1,"method":"DOM.describeNode","params":{"objectId":"0b2954a7-6584-7a49-88f6-08d4e221540d"},"id":19}
1579269043591	RemoteAgent	TRACE	<-(connection {7878ad7a-a940-d044-87c1-376576d4d852}) {"sessionId":1,"id":19,"result":{"node":{"nodeType":1,"nodeName":"IFRAME","localName":"iframe","nodeValue":"","childNodeCount":0,"attributes":["id","foo","src","<div>a</div>"],"frameId":"11"}}}
  puppeteer:protocol ◀ RECV {"sessionId":1,"id":19,"result":{"node":{"nodeType":1,"nodeName":"IFRAME","localName":"iframe","nodeValue":"","childNodeCount":0,"attributes":["id","foo","src","<div>a</div>"],"frameId":"11"}}} +2ms
```

Some still have a wrong value (`nodeId`, `childNodeCount`), which needs to be fixed. But most of the work is still the implementation of the element store.
So we actually have to implement an [element store similar to the one from Marionette](https://searchfox.org/mozilla-central/rev/c52d5f8025b5c9b2b4487159419ac9012762c40c/testing/marionette/element.js#97). With that we have our own mirror of DOM nodes as present in the various targets. Once an element is requested it needs to be added to that store, and at the same time it will get a unique id. Given that we don't have to diverge between the front-end and backend it looks like that `nodeId` and `backgroundNodeId` can be the same.

As temporary solution (which even makes some Puppeteer tests pass) I simply return the node's data. And by that I got nearly all of the available properties filled with data:

```
puppeteer:protocol SEND ► {"sessionId":1,"method":"DOM.describeNode","params":{"objectId":"0b2954a7-6584-7a49-88f6-08d4e221540d"},"id":19} +1ms
  puppeteer:protocol ◀ RECV {"sessionId":1,"id":19,"result":{"node":{"nodeType":1,"nodeName":"IFRAME","localName":"iframe","nodeValue":"","childNodeCount":0,"attributes":["id","foo","src","<div>a</div>"],"frameId":"11"}}} +2ms
```

Some still have a wrong value (`nodeId`, `childNodeCount`), which needs to be fixed. But most of the work is still the implementation of the element store.
So we actually have to implement an [element store similar to the one from Marionette](https://searchfox.org/mozilla-central/rev/c52d5f8025b5c9b2b4487159419ac9012762c40c/testing/marionette/element.js#97). With that we have our own mirror of DOM nodes as present in the various targets. Once an element is requested it needs to be added to that store, and at the same time it will get a unique id. Given that we don't have to diverge between the front-end and backend it looks like that `nodeId` and `backgroundNodeId` can be the same.

As temporary solution (which even makes some Puppeteer tests pass) I simply return the node's data. And by that I got nearly all of the available properties filled with data:

```
puppeteer:protocol SEND ► {"sessionId":1,"method":"DOM.describeNode","params":{"objectId":"0b2954a7-6584-7a49-88f6-08d4e221540d"},"id":19} +1ms
puppeteer:protocol ◀ RECV {"sessionId":1,"id":19,"result":{"node":{"nodeType":1,"nodeName":"IFRAME","localName":"iframe","nodeValue":"","childNodeCount":0,"attributes":["id","foo","src","<div>a</div>"],"frameId":"11"}}} +2ms
```

Some still have a wrong value (`nodeId`, `childNodeCount`), which needs to be fixed. But most of the work is still the implementation of the element store.

Back to Bug 1607560 Comment 3