Bug 1416106 - Part 1: Implement base of property name. r?gl draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 14 Feb 2018 23:18:11 +0900
changeset 755226 1b3f494c39afebd76b5e5a8c7c4a96abd43f1622
parent 754870 e293877d13a5236119adb706c97c55ea9e11868b
child 755227 40f2f200b7fa46ec0d3706ff0ed1b3665342ba28
push id99127
push userbmo:dakatsuka@mozilla.com
push dateThu, 15 Feb 2018 00:47:03 +0000
reviewersgl
bugs1416106
milestone60.0a1
Bug 1416106 - Part 1: Implement base of property name. r?gl MozReview-Commit-ID: GSPIZG31RhB
devtools/client/inspector/animation/components/AnimatedPropertyItem.js
devtools/client/inspector/animation/components/AnimatedPropertyName.js
devtools/client/inspector/animation/components/moz.build
devtools/client/themes/animation.css
--- a/devtools/client/inspector/animation/components/AnimatedPropertyItem.js
+++ b/devtools/client/inspector/animation/components/AnimatedPropertyItem.js
@@ -1,28 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const { PureComponent } = require("devtools/client/shared/vendor/react");
+const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 
+const AnimatedPropertyName = createFactory(require("./AnimatedPropertyName"));
+
 class AnimatedPropertyItem extends PureComponent {
   static get propTypes() {
     return {
       property: PropTypes.string.isRequired,
       values: PropTypes.array.isRequired,
     };
   }
 
   render() {
+    const { property } = this.props;
+
     return dom.li(
       {
         className: "animated-property-item"
-      }
+      },
+      AnimatedPropertyName(
+        {
+          property,
+        }
+      )
     );
   }
 }
 
 module.exports = AnimatedPropertyItem;
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/animation/components/AnimatedPropertyName.js
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { PureComponent } = require("devtools/client/shared/vendor/react");
+const dom = require("devtools/client/shared/vendor/react-dom-factories");
+const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
+
+class AnimatedPropertyName extends PureComponent {
+  static get propTypes() {
+    return {
+      property: PropTypes.string.isRequired,
+    };
+  }
+
+  render() {
+    const { property } = this.props;
+
+    return dom.div(
+      {
+        className: "animated-property-name",
+      },
+      dom.span(
+        {},
+        property
+      )
+    );
+  }
+}
+
+module.exports = AnimatedPropertyName;
--- a/devtools/client/inspector/animation/components/moz.build
+++ b/devtools/client/inspector/animation/components/moz.build
@@ -6,16 +6,17 @@ DIRS += [
     'graph'
 ]
 
 DevToolsModules(
     'AnimatedPropertyItem.js',
     'AnimatedPropertyList.js',
     'AnimatedPropertyListContainer.js',
     'AnimatedPropertyListHeader.js',
+    'AnimatedPropertyName.js',
     'AnimationDetailContainer.js',
     'AnimationDetailHeader.js',
     'AnimationItem.js',
     'AnimationList.js',
     'AnimationListContainer.js',
     'AnimationListHeader.js',
     'AnimationTarget.js',
     'AnimationTimelineTickItem.js',
--- a/devtools/client/themes/animation.css
+++ b/devtools/client/themes/animation.css
@@ -300,16 +300,26 @@
 .animated-property-item {
   height: 30px;
 }
 
 .animated-property-item:nth-child(2n+1) {
   background-color: var(--animation-even-background-color);
 }
 
+/* Animated Property Name */
+.animated-property-name {
+  align-items: center;
+  display: flex;
+  height: 100%;
+  justify-content: flex-end;
+  padding-right: 10px;
+  width: var(--sidebar-width);
+}
+
 /* No Animation Panel */
 .animation-error-message {
   overflow: auto;
 }
 
 .animation-error-message > p {
   white-space: pre;
 }