Skip to content

[css-values] Clarification on Simplification for clamp() with none values #13535

@snowe2010

Description

@snowe2010

The spec for clamp() details that it functions as min() or max() or calc(), depending on where none is specified, but the section for Simplification does not detail how clamp() should be simplified.

Chromium currently simplifies to min() or max(), but WebKit keeps clamp():

<!DOCTYPE html>
<body>
<pre><script>
for (let v of ["clamp(none, 100px, 50%)", "clamp(none, 100px, 150px)"]) {
  document.body.style.width = v;
  document.writeln(`${v}: ${document.body.style.width}`);
}
document.body.style.width = "";
</script></pre>

It seems clarification is needed here on how to simplify clamp in partial simplification cases. Should we Serialize to min/max when partial simplification occurs? or should we serialize to clamp?

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