Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1798)

Unified Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 620783002: Devtools Animations: Basic animation inspection & control in Styles pane (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js
index 98a2adccf72696228080aa2bde43ac1efe99b30b..4f95fdd1d36b1c9219ee2a6c81cc50bebf65c1ae 100644
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -511,10 +511,45 @@ WebInspector.StylesSidebarPane.prototype = {
resultStyles.computedStyle = computedStyle;
}
+ /**
+ * @param {?Array.<!WebInspector.DOMModel.AnimationPlayer>} animationPlayers
+ * @this {WebInspector.StylesSidebarPane}
+ */
+ function animationPlayersCallback(animationPlayers)
+ {
+ for (var i = 0; i < animationPlayers.length; ++i) {
+ var player = animationPlayers[i];
+ var section = new WebInspector.AnimationSection(player);
+ var separatorElement = document.createElement("div");
+ separatorElement.className = "sidebar-separator";
+ separatorElement.createTextChild(WebInspector.UIString("Animation") + " " + player.sequenceNumber());
+ this._sectionsContainer.appendChild(separatorElement);
+ this._sectionsContainer.appendChild(section.element);
+ this._target.cssModel.getKeyframeStylesForNodeAsync(player.sequenceNumber(), keyframeStylesCallback.bind(this, section.element));
+ }
+ }
+
+ /**
+ * @param {?Element} anchorElement
+ * @param {?Array.<!WebInspector.CSSRule>} keyframeStyles
+ * @this {WebInspector.StylesSidebarPane}
+ */
+ function keyframeStylesCallback(anchorElement, keyframeStyles) {
+ // Maintain order of keyframes
+ for (var i = keyframeStyles.length - 1; i >= 0; i--) {
+ // FIXME: Styles should be editable
+ var section = new WebInspector.StylePropertiesSection(this, keyframeStyles[i], false, false);
+ section.expand();
+ this._sectionsContainer.insertBefore(section.element, anchorElement.nextSibling);
+ }
+ }
+
if (this._computedStylePane.isShowing())
this._target.cssModel.getComputedStyleAsync(node.id, computedCallback);
this._target.cssModel.getInlineStylesAsync(node.id, inlineCallback);
this._target.cssModel.getMatchedStylesAsync(node.id, false, false, stylesCallback.bind(this));
+ if (Runtime.experiments.isEnabled("animationInspection"))
+ node.animationPlayers(animationPlayersCallback.bind(this));
},
/**

Powered by Google App Engine
This is Rietveld 408576698