Closed Bug 1459898 Opened 6 years ago Closed 6 years ago

Font editor: implement conversion between unit types

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(firefox63 fixed)

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: rcaliman, Assigned: rcaliman)

References

Details

Attachments

(2 files)

Allow the user to toggle between unit types in font property inputs and have the values adapt proportionally to the new unit.
Status: NEW → ASSIGNED
Priority: -- → P3
Assignee: rcaliman → nobody
Status: ASSIGNED → NEW
Product: Firefox → DevTools
Assignee: nobody → rcaliman
Status: NEW → ASSIGNED
Blocks: 1470375
Comment on attachment 8990737 [details]
Bug 1459898 - (Part 1) Convert between unit types for font-size in font editor.

https://reviewboard.mozilla.org/r/255804/#review263108

::: devtools/client/inspector/fonts/fonts.js:144
(Diff revision 3)
>    /**
> +   * Convert a value for font-size between two CSS unit types.
> +   * Conversion is done via pixels. If neither of the two given unit types is "px",
> +   * recursively get the value in pixels, then convert that result to the desired unit.
> +   *
> +   * @param {Number} value

I think we are missing an extra space after the @param to get it to align with the @return that we have done in this file.

::: devtools/client/inspector/fonts/fonts.js:153
(Diff revision 3)
> +   * @param {String} toUnit
> +   *        CSS unit to convert to.
> +   * @return {Number}
> +   *         Converted numeric value.
> +   */
> +  async convert(value, fromUnit, toUnit) {

s/convert/convertUnits
Attachment #8990737 - Flags: review?(gl) → review+
Comment on attachment 8990769 [details]
Bug 1459898 - (Part 2) Add test for font-size unit conversion.

https://reviewboard.mozilla.org/r/255820/#review263110

::: devtools/client/inspector/fonts/test/head.js:224
(Diff revision 3)
> +}
> +
> +/**
> + * Wait for a predicate to return a result.
> + *
> + * @param {Function} condition

Add an extra space after @param for the proper alignment
Attachment #8990769 - Flags: review?(gl) → review+
Blocks: 1475208
Pushed by rcaliman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d6409658af22
(Part 1) Convert between unit types for font-size in font editor. r=gl
https://hg.mozilla.org/integration/autoland/rev/bbbbc8a982fe
(Part 2) Add test for font-size unit conversion. r=gl
https://hg.mozilla.org/mozilla-central/rev/d6409658af22
https://hg.mozilla.org/mozilla-central/rev/bbbbc8a982fe
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Component: Inspector: Fonts → Inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: