<?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>201692</bug_id>
          
          <creation_ts>2019-09-11 11:50:27 -0700</creation_ts>
          <short_desc>ES Modules should respect &lt;base&gt; tag</short_desc>
          <delta_ts>2022-11-29 22:28:02 -0800</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 12</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</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Guy Bedford">guybedford</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>mark.lam</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1569956</commentid>
    <comment_count>0</comment_count>
    <who name="Guy Bedford">guybedford</who>
    <bug_when>2019-09-11 11:50:27 -0700</bug_when>
    <thetext>When using the &lt;base href&gt; tag, the value should affect the resolution of ES modules when resolving top-level module scripts with relative imports.

For example:

```
&lt;base href=&quot;/modules/&quot; /&gt;
&lt;script type=&quot;module&quot;&gt;
import &apos;./module.js&apos;;
&lt;/script&gt;
```

should load `/modules/module.js` and not `/module.js`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1569957</commentid>
    <comment_count>1</comment_count>
    <who name="Guy Bedford">guybedford</who>
    <bug_when>2019-09-11 11:55:32 -0700</bug_when>
    <thetext>Correction: the problem is specifically for dynamic imports:

```
&lt;base href=&quot;/modules/&quot; /&gt;
&lt;script type=&quot;module&quot;&gt;
import(&apos;./module.js&apos;);
&lt;/script&gt;
```

where the top-level parent for the dynamic import should still respect the base.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1570817</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-09-13 20:23:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/55361194&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662929</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-06-15 18:22:52 -0700</bug_when>
    <thetext>The problem is that import is using SourceOrigin information. We should add a flag to that like, &quot;this source is inlined script etc.&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>