Bug 1379109 - Make x and y dimensions default to -x- instead of undefined x undefined. r=micah
authorGabriel Luong <gabriel.luong@gmail.com>
Tue, 25 Jul 2017 21:01:51 -0400
changeset 419706 4ede5d14ffb11baae01347fed349a94a48603e47
parent 419705 08bef58cdb9db462ebfaeabd6e6cbd92d7ddbe08
child 419707 a3a834899c7335e179ad77d0b48b9ed6df0a231a
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmicah
bugs1379109
milestone56.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 1379109 - Make x and y dimensions default to -x- instead of undefined x undefined. r=micah
devtools/client/inspector/boxmodel/components/BoxModelInfo.js
devtools/client/inspector/boxmodel/components/BoxModelMain.js
--- a/devtools/client/inspector/boxmodel/components/BoxModelInfo.js
+++ b/devtools/client/inspector/boxmodel/components/BoxModelInfo.js
@@ -30,20 +30,20 @@ module.exports = createClass({
   onToggleGeometryEditor(e) {
     this.props.onToggleGeometryEditor();
   },
 
   render() {
     let { boxModel } = this.props;
     let { geometryEditorEnabled, layout } = boxModel;
     let {
-      height,
+      height = "-",
       isPositionEditable,
       position,
-      width,
+      width = "-",
     } = layout;
 
     let buttonClass = "layout-geometry-editor devtools-button";
     if (geometryEditorEnabled) {
       buttonClass += " checked";
     }
 
     return dom.div(
--- a/devtools/client/inspector/boxmodel/components/BoxModelMain.js
+++ b/devtools/client/inspector/boxmodel/components/BoxModelMain.js
@@ -115,38 +115,38 @@ module.exports = createClass({
    * Returns true if the position is displayed and false otherwise.
    */
   getDisplayPosition() {
     let { layout } = this.props.boxModel;
     return layout.position && layout.position != "static";
   },
 
   getHeightValue(property) {
-    let { layout } = this.props.boxModel;
-
     if (property == undefined) {
       return "-";
     }
 
+    let { layout } = this.props.boxModel;
+
     property -= parseFloat(layout["border-top-width"]) +
                 parseFloat(layout["border-bottom-width"]) +
                 parseFloat(layout["padding-top"]) +
                 parseFloat(layout["padding-bottom"]);
     property = parseFloat(property.toPrecision(6));
 
     return property;
   },
 
   getWidthValue(property) {
-    let { layout } = this.props.boxModel;
-
     if (property == undefined) {
       return "-";
     }
 
+    let { layout } = this.props.boxModel;
+
     property -= parseFloat(layout["border-left-width"]) +
                 parseFloat(layout["border-right-width"]) +
                 parseFloat(layout["padding-left"]) +
                 parseFloat(layout["padding-right"]);
     property = parseFloat(property.toPrecision(6));
 
     return property;
   },