Skip to content

[cssom-1] font-family descriptor should not be serialized if not present, fix #13323#13847

Merged
svgeesus merged 1 commit into
mainfrom
font-family-optional
Apr 28, 2026
Merged

[cssom-1] font-family descriptor should not be serialized if not present, fix #13323#13847
svgeesus merged 1 commit into
mainfrom
font-family-optional

Conversation

@svgeesus

Copy link
Copy Markdown
Contributor

[cssom-1] Fixes #13323

@svgeesus svgeesus requested a review from emilio April 28, 2026 14:59

@emilio emilio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but it reads a bit weird to me? Maybe it should be reworded in terms of a temporary string and appending or something. But seems fine either way :)

@svgeesus svgeesus merged commit 75299e7 into main Apr 28, 2026
@svgeesus svgeesus deleted the font-family-optional branch April 28, 2026 15:08
Comment thread cssom-1/Overview.bs
Comment on lines 1901 to +1904
<li>The string "<code>@font-face {</code>", followed by a single SPACE (U+0020).</li>
<li>The string "<code>font-family:</code>", followed by a single SPACE (U+0020).</li>
<li>The result of performing <a>serialize a string</a> on the rule’s font family name.</li>
<li>The string "<code>;</code>", i.e., SEMICOLON (U+003B).
<li>If the '@font-face/font-family' descriptor is present:
<ol>
<li>The string "<code>font-family:</code>", followed by a single SPACE (U+0020).</li>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm late, but I think the space added in step 1 also needs changing, to be added in step 2.1 instead. Otherwise, if there is no font-family, then step 3.1 below will mean there are two spaces between the { and the first descriptor name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cssom] Serialization of @font-face assumes font-family descriptor is always present

3 participants