<?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>232906</bug_id>
          
          <creation_ts>2021-11-09 14:33:13 -0800</creation_ts>
          <short_desc>CSS variables in partial URLs are resolving to the current domain instead of the stylesheet&apos;s domain</short_desc>
          <delta_ts>2021-11-10 15:04:56 -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>CSS</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>230243</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=232919</see_also>
          <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="David Mahaffy">dm</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>heycam</cc>
    
    <cc>koivisto</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1813340</commentid>
    <comment_count>0</comment_count>
    <who name="David Mahaffy">dm</who>
    <bug_when>2021-11-09 14:33:13 -0800</bug_when>
    <thetext>When using CSS variables to populate URLs with relative paths (i.e. &quot;/myapp/gifs/happy.gif&quot;) and linking the stylesheet from a subdomain, WebKit is resolving the partial URL to the parent domain instead of the subdomain.

Per the W3 spec, the partial URL should be resolved according to the location of the stylesheet:
https://www.w3.org/TR/CSS1/#url

For example, if the stylesheet is located on www.mysite.com but it&apos;s being linked by a page in www.subsite.mysite.com, and the partial URL is &quot;/myapp/gifs/happy.gif&quot; I would expect the URL to resolve to &quot;www.mysite.com/myapp/gifs/happy.gif&quot; but WebKit is resolving it as &quot;www.subsite.mysite.com/myapp/gifs.happy.gif&quot;

An example page demonstrating this behavior:
https://qa.ea.financial-net.com/cssVarTest.html

The image appears correctly when opened in Chrome, Firefox, Brave, Opera, Edge on Windows or Android, but Safari does not display the image because the stylesheet and graphic are both on the qa.financial-net.com domain but WebKit is trying to pull the graphic from the qa.ea.financial-net.com domain.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1813710</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-11-10 11:09:09 -0800</bug_when>
    <thetext>Seems like this is a duplicate of bug 230243, which was fixed in September, likely to late to be in Safari 15. I’ll check when I get a chance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1813812</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2021-11-10 15:04:56 -0800</bug_when>
    <thetext>Yes, verified this is a duplicate.

*** This bug has been marked as a duplicate of bug 230243 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>