Bug 1475208 - (Part 6) Cast property values to string before writing to store and stylesheet. r=gl
authorRazvan Caliman <rcaliman@mozilla.com>
Fri, 03 Aug 2018 11:37:14 +0200
changeset 430557 2ad148a42f6c5a73e385197665c63309867fb164
parent 430556 d473e53176769aa24fd35ae712a9da226fddac2b
child 430558 f97e87302374a8a9e4f76e7a3a5fc65206262c01
push id34409
push usertoros@mozilla.com
push dateThu, 09 Aug 2018 10:00:05 +0000
treeherdermozilla-central@eb9ff7de69ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1475208
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1475208 - (Part 6) Cast property values to string before writing to store and stylesheet. r=gl MozReview-Commit-ID: 7AFkD12TbOE
devtools/client/inspector/fonts/fonts.js
--- a/devtools/client/inspector/fonts/fonts.js
+++ b/devtools/client/inspector/fonts/fonts.js
@@ -749,35 +749,37 @@ class FontInspector {
    * from the Font Editor. This handler calls the appropriate method to preview the
    * changes on the page and update the store.
    *
    * If the property parameter is not a recognized CSS font property name, assume it's a
    * variable font axis name.
    *
    * @param  {String} property
    *         CSS font property name or axis name
-   * @param  {String} value
-   *         CSS font property numeric value or axis value
+   * @param  {String|Number} value
+   *         CSS font property value or axis value
    * @param  {String|undefined} fromUnit
    *         Optional CSS unit to convert from
    * @param  {String|undefined} toUnit
    *         Optional CSS unit to convert to
    */
   async onPropertyChange(property, value, fromUnit, toUnit) {
     if (FONT_PROPERTIES.includes(property)) {
       let unit = fromUnit;
 
       if (toUnit && fromUnit) {
         value = await this.convertUnits(value, fromUnit, toUnit);
         unit = toUnit;
       }
 
-      this.onFontPropertyUpdate(property, value, unit);
+      // Cast value to string.
+      this.onFontPropertyUpdate(property, value + "", unit);
     } else {
-      this.onAxisUpdate(property, value);
+      // Cast axis value to string.
+      this.onAxisUpdate(property, value + "");
     }
   }
 
   /**
    * Handler for "property-value-updated" event emitted from the rule view whenever a
    * property value changes. Ignore changes to properties unrelated to the font editor.
    *
    * @param {Object} eventData