<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>314037</bug_id>
          
          <creation_ts>2026-05-04 17:04:39 -0700</creation_ts>
          <short_desc>[Site Isolation] subtest 4 of imported/w3c/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html is failing</short_desc>
          <delta_ts>2026-05-13 23:54:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anthony Tarbinian">a.tarbinian</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2207433</commentid>
    <comment_count>0</comment_count>
    <who name="Anthony Tarbinian">a.tarbinian</who>
    <bug_when>2026-05-04 17:04:39 -0700</bug_when>
    <thetext>This bug pertains to subtest 4 of imported/w3c/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html
which fails with site isolation enabled.

This subtest is the one titled:
&quot;postMessaging with a MessageChannel that&apos;s been cross-site should succeed	&quot;

Here&apos;s the order of events in the test:

1. cross-origin iframe sends port1 to parent
2.parent sends SAB across port1 (port2 is currently in cross-origin iframe). WebKit drops the SharedArrayBuffer since it&apos;s trying to be sent across processes (this is because SharedArrayBuffers are not serialized over IPC. I&apos;ll explain this below)
3. cross-origin iframe sends port2 to parent
4. parent starts listening for onmessage and tries to read the SAB. I think WebKit should wait until this point to send the message

WebKit drops SharedArrayBuffers that are attempted to be sent cross-process:
1. Start off in MessagePort::postMessage. Note how we create a SerializedScriptValue with a SerializationContext of SerializationContext::WorkerPostMessage, this will be relevant in the next step.
    https://github.com/WebKit/WebKit/blob/013da9aa8cc1a0e26f5f34408efa118956499193/Source/WebCore/dom/MessagePort.cpp#L158
2. When the data is serialized in SerializedScriptValue::dumpIfTerminal, there&apos;s a case for SerializationContext::WorkerPostMessage where it copies over the contents of the shared array buffer.
    https://github.com/WebKit/WebKit/blob/013da9aa8cc1a0e26f5f34408efa118956499193/Source/WebCore/bindings/js/SerializedScriptValue.cpp#L2190-L2203
3. The message is actually sent over IPC in WebMessagePortChannelProvider::postMessageToRemote
    https://github.com/WebKit/WebKit/blob/013da9aa8cc1a0e26f5f34408efa118956499193/Source/WebKit/WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp#L127
4. However, this IPC message which is defined in MessageWithMessagePorts and contains SerialiazedScriptValue which contains the sharedBufferContentsArray which is defined as [NotSerialized] :
  [NotSerialized] std::unique_ptr&lt;Vector&lt;JSC::ArrayBufferContents&gt;&gt; sharedBufferContentsArray;
  https://github.com/WebKit/WebKit/blob/013da9aa8cc1a0e26f5f34408efa118956499193/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in#L8011</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207434</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-04 17:04:45 -0700</bug_when>
    <thetext>&lt;rdar://problem/176222943&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207474</commentid>
    <comment_count>2</comment_count>
    <who name="Anthony Tarbinian">a.tarbinian</who>
    <bug_when>2026-05-04 18:39:37 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64231</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210796</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-13 23:54:43 -0700</bug_when>
    <thetext>Committed 313226@main (49d2e914a4cc): &lt;https://commits.webkit.org/313226@main&gt;

Reviewed commits have been landed. Closing PR #64231 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>