← 返回首页
[css-backgrounds] Always serialize 'background-size' and `mask-size` as two values · Issue #7802 · w3c/csswg-drafts · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

[css-backgrounds] Always serialize 'background-size' and mask-size as two values #7802

New issue
New issue

Description

See whatwg/compat#28

That change is now implemented in WebKit: WebKit/WebKit#3372

Relevant CSS specs: https://drafts.csswg.org/css-backgrounds-3/#background-size and https://drafts.csswg.org/cssom/#serialize-a-css-value

@pxlcoder asked

Do we have consensus from other engines on:

Always serialize background-size as two values.

CSSOM says

  • If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.

  • If either of the above syntactic translations would be less backwards-compatible, do not perform them.

The last bullet point seems to apply here, as it impacts -webkit-background-size if implemented as a legacy shorthand. But maybe we can include each known property with special serialization, and what that serialization should be, so it's not ambiguous for those properties.

@pxlcoder also asked:

Should we also change the serialization of mask-size to always use two values, for consistency?

Since mask-size also has a -webkit- prefixed variant and also uses <bg-size># value grammar, I think it makes sense to use the same serialization rule as for background-size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Regular agenda items

    Status

    Tuesday Afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.