Open Bug 1728165 Opened 4 years ago Updated 6 months ago

Trim trailing whitespaces in CSS value containing var()

Categories

(Core :: CSS Parsing and Computation, defect, P3)

Firefox 91
defect

Tracking

()

People

(Reporter: gui.lebas, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Steps to reproduce:

Set the color CSS property value to var( --blue ) via element.style or in a stylesheet.

Actual results:

The serialized value output from element.getPropertyValue('color') is var( --blue ).

Expected results:

The output should be var( --blue ), ie. the trailing whitespaces should be trimmed in the original string, according to the intent of W3C spec authors declared in this issue of the w3c/csswg-drafts Github repository for serializing a var()-containg value the same way as a custom property value, and following Emilio's request to fill this bug: https://github.com/w3c/csswg-drafts/issues/6484

Whitespaces have been trimmed by the Markdown parser in my above comment. I was meaning (whitespace is replaced by _):

Steps to reproduce:

Set the color CSS property value to __var( --blue )__ via element.style or in a stylesheet.

Actual results:

The serialized value output from element.getPropertyValue('color') is var(__--blue__)__.

Expected results:

The output should be var(__--blue__).

The Bugbug bot thinks this bug should belong to the 'Core::DOM: CSS Object Model' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: CSS Object Model
Product: Firefox → Core
Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: DOM: CSS Object Model → CSS Parsing and Computation
Ever confirmed: true
Priority: -- → P3
No longer blocks: 968240
You need to log in before you can comment on or make changes to this bug.