Skip to content

[css-animations] Clarify whether <keyframes-name> supports the empty string #7762

@yisibl

Description

@yisibl

The spec allows <string> here #118 (comment), but does not further clarify whether empty strings("" or " ") are allowed.

@ewilligers Says:

Also, do we want to ban the empty string '""' ?
#2435 (comment)

  • From the CSS author's point of view, empty strings seem to be meaningless.
  • For current implementations across browsers, this has significant compatibility issues.

@keyframes "" {}

If the browser supports it, the page background color will be green.

@-webkit-keyframes "" {
    to {
        background: green
    }
}

@-moz-keyframes "" {
    to {
        background: green
    }
}

body {
    background: red;
    -webkit-animation: "" 0s ease 1 forwards;
    -moz-animation: "" 0s ease 1 forwards;
}
  • -webkit- (Chrome) ✅
  • -webkit-(Safari) ❌
  • -moz-(Firefox) ❌
  • without prefix(both) ❌ Firefox bug

@keyframes " " {}

@-webkit-keyframes " " {
    to {
        background: green
    }
}

@-moz-keyframes " " {
    to {
        background: green
    }
}

body {
    background: red;
    -webkit-animation: " " 0s ease 1 forwards;
    -moz-animation: " " 0s ease 1 forwards;
}
  • -webkit- (Chrome) ✅
  • -webkit-(Safari) ✅
  • -moz-(Firefox) ✅

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions