Open Bug 1420517 Opened 8 years ago Updated 7 months ago

Trim whitespaces around property value with variable references

Categories

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

enhancement

Tracking

()

Tracking Status
firefox59 --- affected

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

There was a CSSWG resolution in w3c/csswg-drafts#774 that whitespaces around property value should be trimmed. I think it makes sense to do so, and add back the whitespaces when serializing. This would help us storing some bytes less data in common cases, and I believe after doing this, it would be worth adding a shortcut for the case that an unparsed value only containing a variable reference. We may not need to do extra allocation, for example, in that case.
Priority: -- → P3
Severity: normal → S3

jQuery works around this issue in https://github.com/jquery/jquery/blob/3.7.1/src/css/curCSS.js#L45-L61. This used to be needed for Chrome as well but right now we need this code for Firefox only.

Bug 1728165 is similar and may cause similar issues but we don't workaround it at the moment.

You need to log in before you can comment on or make changes to this bug.