Skip to content

Commit

Permalink
[css-values-4] Allow B in round() to be omitted, default to 1. #9668
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Mar 11, 2024
1 parent 875e992 commit 2bccebb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion css-values-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,7 @@ Stepped Value Functions: ''round()'', ''mod()'', and ''rem()''</h3>
according to another "step value",
in different ways.

The <dfn lt="round()">round(<<rounding-strategy>>?, A, B)</dfn> function
The <dfn lt="round()">round(<<rounding-strategy>>?, A, B?)</dfn> function
contains an optional rounding strategy,
and two [=calculations=] A and B,
and returns the value of A,
Expand Down Expand Up @@ -3302,6 +3302,11 @@ Stepped Value Functions: ''round()'', ''mod()'', and ''rem()''</h3>
If <<rounding-strategy>> is omitted,
it defaults to ''nearest''.
(Aka [=rounding to the nearest integer=].)
If the [=CSSNumericValue/type=] of A
matches <<number>>,
then B may be omitted,
and defaults to ''1'';
omitting B is otherwise invalid.

Issue(5689): CSSOM needs to specify how it rounds,
and it's probably good for CSS functions to round the same way by default.
Expand Down Expand Up @@ -5531,6 +5536,8 @@ Recent Changes</h3>
and added one on 'scrollbar-gutter'
to make it possible for 100 of these units to actually match the [=initial containing block=].
(<a href="https://github.com/w3c/csswg-drafts/issues/6026">Issue 6026</a>)
* Allow B to be omitted in ''round()'' if the A's type is <<number>>.
(<a href="https://github.com/w3c/csswg-drafts/issues/9668">Issue 9668</a>)

Substantial changes since <a href="https://www.w3.org/TR/2023/WD-css-values-4-20231027/">27 October 2023 WD</a>:

Expand Down

2 comments on commit 2bccebb

@cdoublev
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also make the change in the production rule please?

@tabatkins
Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, yup, forgot that the actual function syntaxes were elsewhere. Thanks for the catch.

Please sign in to comment.