<?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>298016</bug_id>
          
          <creation_ts>2025-08-28 00:01:09 -0700</creation_ts>
          <short_desc>REGRESSION(2.49.4): [GTK] Array with named members not passed properly to the UI process</short_desc>
          <delta_ts>2025-08-29 07:10:21 -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>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Milan Crha">mcrha</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>yaneti</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2139275</commentid>
    <comment_count>0</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2025-08-28 00:01:09 -0700</bug_when>
    <thetext>Coming from downstream bug:
https://gitlab.gnome.org/GNOME/evolution/-/issues/3124

Evolution creates an object with named members like this in the JavaScript code and passes it to the UI process through the messages:

	var res = [];

	res[&quot;iframe-id&quot;] = parent_iframe_id;
	res[&quot;elem-id&quot;] = elem.id;
	res[&quot;elem-class&quot;] = elem.className;
	res[&quot;elem-value&quot;] = elem.getAttribute(&quot;value&quot;);
	res[&quot;left&quot;] = with_parents_left - scroll_x;
	res[&quot;top&quot;] = with_parents_top - scroll_y;
	res[&quot;width&quot;] = elem.offsetWidth;
	res[&quot;height&quot;] = elem.offsetHeight;

	window.webkit.messageHandlers.elementClicked.postMessage(res);

This worked up until 2.49.4, which reports on the UI side that the member&apos;s value is `undefined`, instead of the value. I tried with &quot;elem-class&quot; and with index 0.

Michael pointed to [1] in the downstream bug report.

[1] https://github.com/WebKit/WebKit/pull/47851</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139277</commentid>
    <comment_count>1</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2025-08-28 00:04:58 -0700</bug_when>
    <thetext>For the record, the client side expects the first four members to be strings and the last four members to be integers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139331</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-08-28 05:07:52 -0700</bug_when>
    <thetext>I&apos;m guessing either &quot;Make JavaScriptEvaluationResult platform independent&quot; or one of Alex&apos;s other recent commits to APISerializedScriptValue/JSEvaluationResult.

So we can&apos;t send objects anymore, but we can send &quot;dictionaries&quot;...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139424</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2025-08-28 11:54:33 -0700</bug_when>
    <thetext>That is an array being used as a dictionary.  I think the cleanest solution would be to change &quot;var res = [];&quot; to &quot;var res = {};&quot; downstream.  If you really want to continue supporting things like that, we could but it would be a strange platform-specific thing because other platforms don&apos;t expose such properties on array results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139429</commentid>
    <comment_count>4</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2025-08-28 12:02:19 -0700</bug_when>
    <thetext>The problem might be that this worked for years and suddenly does not. I can patch the Evolution code (hoping I&apos;d not miss anything), but the WebkitGTK is updated in distros down to the Evolution versions which are obsolete for the upstream, thus any such potential fix won&apos;t get there and users with old Evolution will face the crash only because the distros do update WebKitGTK, but not Evolution (and other users of it, most likely). That does not feel great - not that it did not happen in the past though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139480</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-08-28 14:07:02 -0700</bug_when>
    <thetext>Honestly if this is the only regression from all this work, then I&apos;m pretty happy. I wasn&apos;t sure what to expect.

It&apos;s probably best to just patch Evolution and carry the patches for as long as needed. Sorry Milan. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139594</commentid>
    <comment_count>6</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2025-08-28 22:37:57 -0700</bug_when>
    <thetext>It might be best for you, but not for package/distro maintainers. That&apos;s a pita. I know the WebKitGTK developers do not care of these silly things, but still.

I understood this is actually a bug in the Evolution JavaScript code, the arrays do not have named indexes, they have numbered indexes. That it worked before was just a matter of luck, right? I do not recall where I&apos;ve got that code from, it&apos;s a long time since I created it. I will fix it for the upcoming release (3.57.3), I see it&apos;s used on multiple places, interestingly not on all.

That you for the hint how to correct it (I&apos;m not a JavaScript person, it&apos;s odd I could generate so much code in it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139595</commentid>
    <comment_count>7</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2025-08-28 22:47:25 -0700</bug_when>
    <thetext>For the reference, a fix for the upstream bug is https://gitlab.gnome.org/GNOME/evolution/-/commit/811a6df1f990855e49ecc0ba7b1a7f7a5ec251e6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>