Closed Bug 1752780 Opened 3 years ago Closed 3 years ago

Decreasing a unitless value in the CSS panel of devtools adds `px` unit below 0

Categories

(DevTools :: Inspector: Rules, defect, P2)

Firefox 97
defect

Tracking

(firefox99 verified)

VERIFIED FIXED
99 Branch
Tracking Status
firefox99 --- verified

People

(Reporter: nicolas, Assigned: jdescottes)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0

Steps to reproduce:

  • open devtools
  • find a CSS property with a positive value without unit (line-height for example, or a custom property)
  • decrease the value down to 0 with 0.1 steps ([Option] + [↓] on macOS), and continue decreasing

Actual results:

  • after going to negative values, Firefox adds a px unit

Expected results:

No unit should have been added (if the initial value was unitless), at least to properties that support unitless values like line-height) or custom properties.

It looks like it work for 1 steps, the issue is with 0.1 steps.

Took the liberty to triage into DevTools > Inspector: Rules.

Can confirm the issue in Nightly when using the step=-0.1 changes (Option+ArrowDown).
The step=1 step (ArrowDown) and step=10 (Shift+ArrowDown) don't seem affected.

Basic test case:

:root {
  --custom: 0.5;
  line-height: 1.4;
}
Component: Untriaged → Inspector: Rules
Product: Firefox → DevTools
Target Milestone: --- → Future

Thanks Florens.

It looks like increasing the value from 0 with 0.1 steps has the same issue than decreasing.

Thanks for the report and investigation :) Confirming the issue, will be triaged later this week!

Status: UNCONFIRMED → NEW
Ever confirmed: true

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(jdescottes)
Assignee: nobody → jdescottes
Severity: -- → S3
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)
Priority: -- → P2
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fec9e1d961d8 [devtools] Do not force units when incrementing unitless CSS properties r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
See Also: → 1756553
QA Whiteboard: [qa-99b-p2]

Reproduced the issue on build 98.0a1 without fix on Mac 10.13. Could not reproduce on Win10, only on Mac.
Verified as fixed on Mac 10.13 using build 99.0 (20220328190900).

Status: RESOLVED → VERIFIED
Target Milestone: Future → 99 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: