[wpt-sync] Sync PR 65071 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=331066
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 65071 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/65071
Details from upstream follow.
Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=331066
WebKit export from bug: MessagePort.<!---->postMessage(<!---->)<!----> throws DataCloneError when transferring its own entangled port
<pre>
MessagePort.postMessage() throws DataCloneError when transferring its own entangled port
- If transfer contains sourcePort, then throw a "DataCloneError" DOMException.
- Let doomed be false.
- If targetPort is not null and transfer contains targetPort, then set doomed
to true and optionally report to a developer console that the target port
was posted to itself, causing the communication channel to be lost.- Let serializeWithTransferResult be StructuredSerializeWithTransfer(message,
transfer). Rethrow any exceptions.- If targetPort is null, or if doomed is true, then return.
WebKit threw a "DataCloneError" both when transfer contained sourcePort and
when it contained targetPort. Chrome and Firefox follow the spec. They don't
throw for targetPort; they detach it and drop the message.This patch makes MessagePort::postMessage() follow the spec steps in order.
The check for sourcePort (step 2) now happens before serialization. A
transfer list containing targetPort sets doomed (step 4) and logs a console
warning. After serialization detaches the transferred ports (step 5), a
doomed message is not posted (step 6). The ports it carried are closed so
the MessagePortChannelProvider doesn't keep them as in transit.WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=331066">https://bugs.webkit.org/show_bug.cgi?id=331066</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/326479@main">https://commits.webkit.org/326479@main</a>
</pre>
| Assignee | ||
Updated•10 days ago
|
| Assignee | ||
Updated•10 days ago
|
| Assignee | ||
Updated•10 days ago
|
| Assignee | ||
Comment 1•10 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 2 tests and 3 subtests
Status Summary
Firefox
OK : 2
PASS: 6
Chrome
OK : 2
PASS: 6
Safari
OK : 2
FAIL: 6
Links
Comment 3•8 days ago
|
||
| bugherder | ||
Description
•