WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
271626
[serialization] font-family serialization should be kept as-is with quotes.
https://bugs.webkit.org/show_bug.cgi?id=271626
Summary
[serialization] font-family serialization should be kept as-is with quotes.
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
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-03-24 21:58:11 PDT
<
rdar://problem/125334960
>
Vitor Roriz
Comment 2
2026-03-23 16:46:36 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/61204
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.
Top of Page
Format For Printing
XML
Clone This Bug