W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

Re: [csswg-drafts] [css-om] Serialization of font-family names: quoted string vs keyword (#5846)

From: Frédéric Wang via GitHub <sysbot+gh@w3.org>
Date: Thu, 12 Aug 2021 09:08:33 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-897474104-1628759312-sysbot+gh@w3.org>
Blink basically does not add quote to a `<family-name>` iff it can be parsed as a CSS <ident> minus backslash-escape sequences:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/css_markup.cc;l=145;drc=0a7ae0e6c7f507bf4d102df97e733628566b4736

There is a bug though : `"serif"` (with quotes i.e. `<font-family>`) becomes `serif` (without quotes i.e. `<generic-family>`) when serialized. See the two second case of 

https://w3c-test.org/css/cssom/font-family-serialization-001.html

But it's easy to fix by always adding quotes if the name is the same as a `<generic-family>`.

I think the spec should clearly specify how to serialize `font-family` if it is different from a comma-separated list of identifiers/strings.

-- 
GitHub Notification of comment by fred-wang
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5846#issuecomment-897474104 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 12 August 2021 09:08:35 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:42 UTC