Closed sadym-chromium closed 3 months ago
@jimevans WDYT? Would it still cover the use cases?
I think (if I remember correctly) we originally added both because of a request from Google. From our side we do not have a special use-case given as you say the sharedId
is stable as long as the process exists.
@sadym-chromium We need sandbox
because we call into the get a realm from a target algorithm. Likewise, we need ownership
because we call into the serialize as a remote value algorithm. If we can make appropriate assumptions about the inputs of those values into those algorithms, yes, let’s remove the properties, but I don’t think you can make such assumptions (@jgraham correct me if I’m wrong).
Alternatively, if you want to reconfigure the remote end steps to use different algorithms, I’d be fine removing the properties in that case too. It’s unclear to me what other algorithms should be used in place of those cited above, but I’ll review any PR that makes an attempt to do so.
I think (if I remember correctly) we originally added both because of a request from Google. From our side we do not have a special use-case given as you say the
sharedId
is stable as long as the process exists.
@whimboo If we talk about a generic script serialization, we cannot provide a stable sharedId
for a generic ecmascript objects, only for DOM. But the browsingContext.locateNodes
returns a list of nodes, and we can do that.
@jimevans so the idea is to serialize with ownership: none
, and never provide a handle. If so, we don't need a sandbox anymore. The serialize as a remote value requires realm only to provide handles in
step 4 Let handle id be the handle for an object with realm, ownership type and value.
If we don't have a major concerns here, I will prepare a PR.
Here we go: https://github.com/w3c/webdriver-bidi/pull/688
Implemented in https://github.com/w3c/webdriver-bidi/pull/688.
browsingContext.locateNodes
returns an array ofscript.NodeRemoteValue
, andsharedId
can be used instead ofhandle
throughout all the sandboxes.The reason for that is that in CDP implementation, resolving
handle
can be done only for the top-level object returned in result. And having that, in order to provide handles for all the nodes, a dedicated CDP call per node in the result should be done.