Bug 271626

Summary: [serialization] font-family serialization should be kept as-is with quotes.
Product: WebKit Reporter: Karl Dubost <karlcow>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: vitor.roriz, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   
URL: http://wpt.live/css/css-fonts/parsing/font-family-computed.html

Karl Dubost
Reported 2024-03-24 21:57:16 PDT
With data:text/html,<div style='font-family:"inherit", "serif"'>hello</div> aka assigning to the div a style attribute. var div = document.querySelector('div'); div.style['font-family'] = '"inherit", "serif"' We can see that the serialization of the style attribute is wrong in Safari. It normalizes the values without the quotes. Safari: > target.style.cssText < "font-family: inherit, serif;" > window.getComputedStyle(target).fontFamily < "inherit, serif" Firefox, Chrome: target.style.cssText 'font-family: "inherit", "serif";' window.getComputedStyle(target).fontFamily '"inherit", "serif"' Same thing is happening for a font-name Safari > target.style['font-family'] = '"Helvetica"' < "\"Helvetica\"" > target.style.cssText < "font-family: Helvetica;" > window.getComputedStyle(target).fontFamily < "Helvetica" Firefox: target.style['font-family'] = '"Helvetica"' '"Helvetica"' target.style.cssText 'font-family: "Helvetica";' window.getComputedStyle(target).fontFamily '"Helvetica"'
Attachments
Radar WebKit Bug Importer
Comment 1 2024-03-24 21:58:11 PDT
Vitor Roriz
Comment 2 2026-03-23 16:46:36 PDT
EWS
Comment 3 2026-03-25 20:19:50 PDT
Committed 309959@main (d8a232e3b659): <https://commits.webkit.org/309959@main> Reviewed commits have been landed. Closing PR #61204 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.