Bug 271626
| Summary: | [serialization] font-family serialization should be kept as-is with quotes. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
| Component: | CSS | Assignee: | 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
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
<rdar://problem/125334960>
Vitor Roriz
Pull request: https://github.com/WebKit/WebKit/pull/61204
EWS
Committed 309959@main (d8a232e3b659): <https://commits.webkit.org/309959@main>
Reviewed commits have been landed. Closing PR #61204 and removing active labels.