servo/components/script_bindings/webidls/MessagePort.webidl
Gregory Terzian af5d665efa
MessagePort: implement disentanglement (#36654)
Implement
[disentangle](https://html.spec.whatwg.org/multipage/#disentangle)
Remove bespoke gc logic which now becomes unnecessary. 
Adds a wpt test that hits the "disentangle while in transfer" logic.
Updates streams code, fixing an error where disentanglement is
conditional on an error.

Test coverage: there are existing tests in
`/webmessaging/message-channels/close-event/explicitly-closed.tentative.window.js`
for the no transfer case, and the simple completed transfer case, and
this PR adds a test for the more complicated transfer in progress case.

Fix https://github.com/servo/servo/issues/36465

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-04-30 10:49:38 +00:00

24 lines
793 B
Text

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* The origin of this IDL file is:
* https://html.spec.whatwg.org/multipage/#messageport
*/
[Exposed=(Window,Worker)]
interface MessagePort : EventTarget {
[Throws] undefined postMessage(any message, sequence<object> transfer);
[Throws] undefined postMessage(any message, optional StructuredSerializeOptions options = {});
undefined start();
undefined close();
// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
attribute EventHandler onclose;
};
dictionary StructuredSerializeOptions {
sequence<object> transfer = [];
};