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>
This commit is contained in:
Gregory Terzian 2025-04-30 12:49:38 +02:00 committed by GitHub
parent c46402e222
commit af5d665efa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 356 additions and 191 deletions

View file

@ -474,7 +474,7 @@ DOMInterfaces = {
'MessagePort': {
'weakReferenceable': True,
'canGc': ['GetOnmessage'],
'canGc': ['Close', 'GetOnmessage', 'SetOnmessage', 'Start'],
},
'MessageEvent': {

View file

@ -16,6 +16,7 @@ interface MessagePort : EventTarget {
// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
attribute EventHandler onclose;
};
dictionary StructuredSerializeOptions {