W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2021

[csswg-drafts] [css-values] Specify how to handle negative percentage basis in mathematical expressions (#6298)

From: Johannes Odland via GitHub <sysbot+gh@w3.org>
Date: Wed, 19 May 2021 18:21:46 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-895747479-1621448504-sysbot+gh@w3.org>
johannesodland has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] Specify how to handle negative percentage basis in mathematical expressions ==
Some properties like object-position can have a negative percentage basis. 

This causes an issue where some browsers calculates/simplifies `clamp(100%, 50%, 0%)` to 100% ignoring the negative percentage basis, but solves `clamp(100%, 50% + 0px, 0%)` to 50%. With a percentage basis of `-100px` the original equation is equal to `clamp(-100px, -50px, 0px)` which would solve to -50px. Solving the equation without accounting for the negative basis creates unexpected behaviour.

(See https://bugzilla.mozilla.org/show_bug.cgi?id=1709018). 

It would be helpful if the spec specified how to handle negative percentage basis in mathematical expressions https://drafts.csswg.org/css-values-4/#calc-func




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6298 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 May 2021 18:21:51 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:44 UTC