<?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>207641</bug_id>
          
          <creation_ts>2020-02-12 10:01:10 -0800</creation_ts>
          <short_desc>Entry realm for promise jobs is incorrect</short_desc>
          <delta_ts>2024-05-07 08:23:40 -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>JavaScriptCore</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Domenic Denicola">d</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1618068</commentid>
    <comment_count>0</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2020-02-12 10:01:10 -0800</bug_when>
    <thetext>https://wpt.live/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html tests the entry (used in, for example, determining the base URL for window.open()) incorrect for promise jobs. (Both promise reaction jobs, and promise resolve thenable jobs.)

It should be derived from the realm of the function in question, as it is for other web platform callbacks. However, this does not appear to be what WebKit does.

The spec governing this is in https://html.spec.whatwg.org/multipage/webappapis.html#enqueuejob(queuename,-job,-arguments) step 3, which was admittedly added very recently, in https://github.com/whatwg/html/pull/5212.

Firefox matches the spec entirely. Chrome has a bug in the promise resolve thenable job case, but matches the spec for the promise reaction job case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1618568</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-02-13 10:14:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/59427516&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>