<?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>268742</bug_id>
          
          <creation_ts>2024-02-05 06:09:38 -0800</creation_ts>
          <short_desc>cssText wrong escaping</short_desc>
          <delta_ts>2024-02-14 17:17:29 -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 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://jsfiddle.net/v57r8dt4/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jozef">32jojo32</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>m_dubet</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2010632</commentid>
    <comment_count>0</comment_count>
    <who name="Jozef">32jojo32</who>
    <bug_when>2024-02-05 06:09:38 -0800</bug_when>
    <thetext>Run this code in safari and see that the cssText is wrongly escaped

const style = document.createElement(&apos;style&apos;)
document.body.append(style)
style.sheet.insertRule(`h6 {
    background: url(/my-image.png), var(--my-image);
}`)
console.log(style.sheet.cssRules[0].cssText)

Output:
h6 { background: url(\/my-image\.png), var(--my-image); }

Chrome and Firefox outputs:
h6 { background: url(/my-image.png), var(--my-image); }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010664</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-05 07:57:44 -0800</bug_when>
    <thetext>*** Safari Technology Preview 187 ***

&quot;h6 { background: url(\/my-image\.png), var(--my-image); }&quot;

*** Chrome Canary 123 ***

&quot;h6 { background: url(/my-image.png), var(--my-image); }&quot;

*** Firefox Nightly 124 ***

&quot;h6 { background: url(/my-image.png), var(--my-image); }&quot;

___

Just wanted to share as of today result. I will share Minibrowesr (WebKit ToT) results later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010695</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-05 09:20:14 -0800</bug_when>
    <thetext>WebKit ToT (274096@main) same as STP187.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010737</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-02-05 10:53:53 -0800</bug_when>
    <thetext>I will note that both outputs are semantically equivalent; have you had this serialisation difference cause problems anywhere?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010738</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-02-05 11:01:46 -0800</bug_when>
    <thetext>See also https://github.com/w3c/csswg-drafts/issues/9913 for the spec not matching any existing major browser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2012660</commentid>
    <comment_count>5</comment_count>
    <who name="Jozef">32jojo32</who>
    <bug_when>2024-02-12 03:31:32 -0800</bug_when>
    <thetext>@Sam Sneddon, I don&apos;t believe it carries the same semantic meaning. There are actually two backslashes.

The raw form is `h6 { background: url(\\/my-image\\.png), var(--my-image); }`.

which is not equal to:
`h6 { background: url(\/my-image\.png), var(--my-image); }`
or
`h6 { background: url(/my-image.png), var(--my-image); }`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2012679</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-02-12 06:10:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/122796093&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>