Skip to content

[css-typed-om] Should a type have a null percent hint to match <number>? #10763

@cdoublev

Description

@cdoublev

Before w3c/css-houdini-drafts@808c87a, a type always had to have a null percent hint to match <number>.

Now:

If the context in which the value is used does not allow <percentage> values, then the type must additionally have a null percent hint to be considered matching.

opacity: calc((1% + 1px) / 1px) is now valid if I am not mistaken, which seems unexpected because what is the resolved value of 1%?

  • the context allows <number> and <percentage> (resolved to <number>)
  • 1% has type [percent → 1]
  • 1% + 1px has type [length → 1] with a length percent hint
  • (1% + 1px) / 1px has type [length → 0] with a length percent hint
  • [length → 0] with a length percent hint matches <number>

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