Closed Bug 1886027 Opened 2 years ago Closed 2 years ago

Sign minus alone is not interpreted in CSS function calc()

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 123
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: florimond.alemps, Unassigned)

Details

Attachments

(1 file)

Attached image minus.svg

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

Written like that "-" is not interpreted in :
transform : translateX(calc(- var(--offset)));

This is the work around:
transform : translateX(calc(-1 * var(--offset)));

Actual results:

transform is not applied

Expected results:

Both statements should produce the same result

The Bugbug bot thinks this bug should belong to the 'Core::Web Painting' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Web Painting
Product: Firefox → Core
Component: Web Painting → CSS Parsing and Computation

The severity field is not set for this bug.
:TYLin, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(aethanyc)

transform : translateX(calc(- var(--offset)));

It looks like the calc() grammar only allows binary operators such as +, -, *, and /, and does not allow unary minus operator https://drafts.csswg.org/css-values/#calc-syntax

The testcase look the same in Firefox, Google Chrome, and Safari, so this bug is likely invalid.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(aethanyc)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: