<?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>271626</bug_id>
          
          <creation_ts>2024-03-24 21:57:16 -0700</creation_ts>
          <short_desc>[serialization] font-family serialization should be kept as-is with quotes.</short_desc>
          <delta_ts>2026-03-25 20:19:52 -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>CSS</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://wpt.live/css/css-fonts/parsing/font-family-computed.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>vitor.roriz</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2023576</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-03-24 21:57:16 -0700</bug_when>
    <thetext>With 
  data:text/html,&lt;div style=&apos;font-family:&quot;inherit&quot;, &quot;serif&quot;&apos;&gt;hello&lt;/div&gt;

aka assigning to the div a style attribute.
  var div = document.querySelector(&apos;div&apos;);
  div.style[&apos;font-family&apos;] = &apos;&quot;inherit&quot;, &quot;serif&quot;&apos;

We can see that the serialization of the style attribute is wrong in Safari. It normalizes the values without the quotes.


Safari:
&gt; target.style.cssText
&lt; &quot;font-family: inherit, serif;&quot;
&gt; window.getComputedStyle(target).fontFamily
&lt; &quot;inherit, serif&quot;

Firefox, Chrome:
target.style.cssText
&apos;font-family: &quot;inherit&quot;, &quot;serif&quot;;&apos;
window.getComputedStyle(target).fontFamily
&apos;&quot;inherit&quot;, &quot;serif&quot;&apos; 


Same thing is happening for a font-name

Safari
&gt; target.style[&apos;font-family&apos;] = &apos;&quot;Helvetica&quot;&apos;
&lt; &quot;\&quot;Helvetica\&quot;&quot;
&gt; target.style.cssText
&lt; &quot;font-family: Helvetica;&quot;
&gt; window.getComputedStyle(target).fontFamily
&lt; &quot;Helvetica&quot;


Firefox:
target.style[&apos;font-family&apos;] = &apos;&quot;Helvetica&quot;&apos;
&apos;&quot;Helvetica&quot;&apos;
target.style.cssText
&apos;font-family: &quot;Helvetica&quot;;&apos;
window.getComputedStyle(target).fontFamily
&apos;&quot;Helvetica&quot;&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023577</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-03-24 21:58:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/125334960&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2192931</commentid>
    <comment_count>2</comment_count>
    <who name="Vitor Roriz">vitor.roriz</who>
    <bug_when>2026-03-23 16:46:36 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61204</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193730</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-03-25 20:19:50 -0700</bug_when>
    <thetext>Committed 309959@main (d8a232e3b659): &lt;https://commits.webkit.org/309959@main&gt;

Reviewed commits have been landed. Closing PR #61204 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>