Bug 1416106 - Part 5: Implement base of keyframes graph. r?gl draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 14 Feb 2018 23:18:12 +0900
changeset 755230 2745b008a0f8589074395de105ce5fd7f6d5c07c
parent 755229 ceae374abb766b879bdb2e5a1ff51bdb63aaed21
child 755231 ad00e160086dc2c1d14a96f500685e12fa2e7335
push id99127
push userbmo:dakatsuka@mozilla.com
push dateThu, 15 Feb 2018 00:47:03 +0000
reviewersgl
bugs1416106
milestone60.0a1
Bug 1416106 - Part 5: Implement base of keyframes graph. r?gl MozReview-Commit-ID: FpTZvREM35Y
devtools/client/inspector/animation/components/AnimatedPropertyItem.js
devtools/client/inspector/animation/components/keyframes-graph/KeyframesGraph.js
devtools/client/inspector/animation/components/keyframes-graph/moz.build
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
@@ -4,16 +4,17 @@
 
 "use strict";
 
 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"));
+const KeyframesGraph = createFactory(require("./keyframes-graph/KeyframesGraph"));
 
 class AnimatedPropertyItem extends PureComponent {
   static get propTypes() {
     return {
       property: PropTypes.string.isRequired,
       state: PropTypes.object.isRequired,
       values: PropTypes.array.isRequired,
     };
@@ -29,14 +30,15 @@ class AnimatedPropertyItem extends PureC
       {
         className: "animated-property-item"
       },
       AnimatedPropertyName(
         {
           property,
           state,
         }
-      )
+      ),
+      KeyframesGraph()
     );
   }
 }
 
 module.exports = AnimatedPropertyItem;
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/animation/components/keyframes-graph/KeyframesGraph.js
@@ -0,0 +1,20 @@
+/* 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");
+
+class KeyframesGraph extends PureComponent {
+  render() {
+    return dom.div(
+      {
+        className: "keyframes-graph"
+      }
+    );
+  }
+}
+
+module.exports = KeyframesGraph;
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/animation/components/keyframes-graph/moz.build
@@ -0,0 +1,7 @@
+# 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/.
+
+DevToolsModules(
+    'KeyframesGraph.js',
+)
--- a/devtools/client/inspector/animation/components/moz.build
+++ b/devtools/client/inspector/animation/components/moz.build
@@ -1,14 +1,15 @@
 # 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/.
 
 DIRS += [
-    'graph'
+    'graph',
+    'keyframes-graph'
 ]
 
 DevToolsModules(
     'AnimatedPropertyItem.js',
     'AnimatedPropertyList.js',
     'AnimatedPropertyListContainer.js',
     'AnimatedPropertyListHeader.js',
     'AnimatedPropertyName.js',
--- a/devtools/client/themes/animation.css
+++ b/devtools/client/themes/animation.css
@@ -300,16 +300,17 @@
   list-style-type: none;
   margin-top: 0;
   overflow-y: auto;
   padding: 0;
 }
 
 /* Animated Property Item */
 .animated-property-item {
+  display: flex;
   height: 30px;
 }
 
 .animated-property-item:nth-child(2n+1) {
   background-color: var(--animation-even-background-color);
 }
 
 /* Animated Property Name */
@@ -351,16 +352,22 @@
   width: 15px;
   -moz-context-properties: fill;
 }
 
 .animated-property-name.warning span {
   text-decoration: underline dotted;
 }
 
+/* Keyframes Graph */
+.keyframes-graph {
+  height: 100%;
+  width: calc(100% - var(--sidebar-width) - var(--graph-right-offset));
+}
+
 /* No Animation Panel */
 .animation-error-message {
   overflow: auto;
 }
 
 .animation-error-message > p {
   white-space: pre;
 }