Closed Bug 1792524 Opened 2 years ago Closed 1 year ago

Add support for serialization and deserialization of platform objects

Categories

(Remote Protocol :: WebDriver BiDi, task, P1)

task
Points:
2

Tracking

(firefox110 fixed)

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: Sasha, Assigned: whimboo)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [webdriver:m5][wptsync upstream][webdriver:relnote])

Attachments

(3 files)

Add support for serialization of the generic platform object. The platform object, which implements WindowProxy, is added in the scope of bug 1770754 and the platform object, which implements Node, will be added in bug 1770731. It will require adding wdspec tests as well.

Lets block bug 1790361 once we know that we can fix it in M5.

It would be good to know how we could identify platform objects vs normal Javascript objects.

No longer blocks: 1790361

Hi Olli, is there an easy way to identify objects as platform objects? As described above we would have to differentiate these from normal JavaScript objects eg. as created by the website. Thanks.

Flags: needinfo?(smaug)
Priority: -- → P2
Whiteboard: [webdriver:backlog]

I assume you'll support only some platform objects. Would <interfacePrototype>.isInstance() work? See the dev-platform message titled
"[dev-platform] chrome-privilieged scripts: instanceof operator against DOM interfaces will soon be strictly rejected"

Flags: needinfo?(smaug)

For reference the thread as mentioned in the last comment can be found here:
https://groups.google.com/a/mozilla.org/g/dev-platform/c/jc_kG5gmdpk/m/fDuAVsJ1BQAJ

We will have to support all the platform objects (except Node of type element and some others that we handle differently) as accessible by web content to match the WebDriver BiDi specification, and everything else as well when we want to use our implementation to also work in chrome scope.

As such is there a way to check if some random object is implemented as interface? I'm fairly sure that's all what we would need.

Flags: needinfo?(smaug)

(not still sure how "serialization" would work)

I can't now immediately think anything which could be used to check whether something implements just any interface.

peterv or edgar might recall.

Flags: needinfo?(smaug) → needinfo?(peterv)

We currently don't have an API to check for "object implements interface".

Flags: needinfo?(peterv)

(In reply to Peter Van der Beken [:peterv] from comment #6)

We currently don't have an API to check for "object implements interface".

Peter, how easy/hard would it be to get such an API added? Also where exactly would this need to happen?

Flags: needinfo?(peterv)

You could expose IsDOMObject (https://searchfox.org/mozilla-central/rev/83b86005c6913c2062419efb8aabdf2e683aa47f/dom/bindings/BindingUtils.h#149) as a ChromeOnly API, I think that'll give you "object implements interface". (Assuming that are the semantics you want, note that it doesn't include interface objects, interface prototype objects, named property objects, …)

Flags: needinfo?(peterv)

Thanks Peter! That sounds good. We will have a look in how to get this implemented, and most likely will file a separate DOM bug for that.

Deserialization is simple enough so that we should combine the work with the serialization work.

Summary: Add support for serialization of platform object → Add support for serialization and deserialization of platform objects
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Points: --- → 2
Priority: P2 → P1
Whiteboard: [webdriver:backlog] → [webdriver:m5]
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/10fa415ea515
[dom] Make isDOMObject() available through ChromeUtils. r=smaug
https://hg.mozilla.org/integration/autoland/rev/865755e816b0
[WebDriver BiDi] Add support for serialization and deserialization of generic platform objects. r=webdriver-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/98ec90915d25
[wdspec] Add tests for serialization and deserialization of generic platform objects. r=webdriver-reviewers,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37674 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m5] → [webdriver:m5], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Upstream PR was closed without merging
Upstream PR merged by jgraham
Whiteboard: [webdriver:m5], [wptsync upstream] → [webdriver:m5][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: