<?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>223122</bug_id>
          
          <creation_ts>2021-03-12 07:53:11 -0800</creation_ts>
          <short_desc>[SameObject] is not applied in FrozenArrays or TypeArrays</short_desc>
          <delta_ts>2021-03-23 08:41:57 -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>Bindings</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>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Imanol Fernandez">ifernandez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>cdumez</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1738894</commentid>
    <comment_count>0</comment_count>
    <who name="Imanol Fernandez">ifernandez</who>
    <bug_when>2021-03-12 07:53:11 -0800</bug_when>
    <thetext>Hi,

I&apos;m trying to pass some WebXR [SameObject] related tests and found that [SameObject] doesn&apos;t work as expected with array related types. JS correctly receives the same object when using DOM wrappers but not when using FrozenArrays o TypedArrays (using Vec&lt;T&gt; and Float32Array in the C++ DOM class).

Is there any problem in the binding code generation or Vec&lt;T&gt;/TypesArrays should be wrapped in a special way to be cached to comply with [SameObject], such as DOMStringList instead of Vec&lt;String&gt;/FrozenArray&lt;String&gt;?

I didn&apos;t find good examples of other module specs using [SameObject] with FrozeArrays/TypedArrays, almost all of them are in WebXR spec :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741504</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-03-18 16:40:30 -0700</bug_when>
    <thetext>        &quot;SameObject&quot;: {
            &quot;contextsAllowed&quot;: [&quot;attribute&quot;],
            &quot;standard&quot;: {
                &quot;url&quot;: &quot;https://heycam.github.io/webidl/#SameObject&quot;
            },
            &quot;unsupported&quot;: true
        },

We just don&apos;t support [SameObject] in WebKit right now. There are way to implement this with JS visitors or [CachedAttribute] though. We do this all the time.

Where are you trying to use it exactly?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741507</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2021-03-18 16:42:58 -0700</bug_when>
    <thetext>(In reply to Chris Dumez from comment #1)
&gt;         &quot;SameObject&quot;: {
&gt;             &quot;contextsAllowed&quot;: [&quot;attribute&quot;],
&gt;             &quot;standard&quot;: {
&gt;                 &quot;url&quot;: &quot;https://heycam.github.io/webidl/#SameObject&quot;
&gt;             },
&gt;             &quot;unsupported&quot;: true
&gt;         },
&gt; 
&gt; We just don&apos;t support [SameObject] in WebKit right now. There are way to
&gt; implement this with JS visitors or [CachedAttribute] though. We do this all
&gt; the time.
&gt; 
&gt; Where are you trying to use it exactly?

MessageEvent.ports seems to be an example of FrozenArray attribute where we&apos;ve implementation our custom &quot;SameObject&quot; support. You may be able to use that as example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741718</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-03-19 08:54:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/75622221&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1742808</commentid>
    <comment_count>4</comment_count>
    <who name="Imanol Fernandez">ifernandez</who>
    <bug_when>2021-03-23 08:41:44 -0700</bug_when>
    <thetext>MessageEvent.ports was a great example, thanks!

I implemented the related changes in bug 223635</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>