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

Side by Side Diff: Source/devtools/front_end/elements/ElementsPanel.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, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 this._matchedStylesFilterBoxContainer = document.createElement("div"); 73 this._matchedStylesFilterBoxContainer = document.createElement("div");
74 this._matchedStylesFilterBoxContainer.className = "sidebar-pane-filter-box"; 74 this._matchedStylesFilterBoxContainer.className = "sidebar-pane-filter-box";
75 this._computedStylesFilterBoxContainer = document.createElement("div"); 75 this._computedStylesFilterBoxContainer = document.createElement("div");
76 this._computedStylesFilterBoxContainer.className = "sidebar-pane-filter-box" ; 76 this._computedStylesFilterBoxContainer.className = "sidebar-pane-filter-box" ;
77 this.sidebarPanes.styles.setFilterBoxContainers(this._matchedStylesFilterBox Container, this._computedStylesFilterBoxContainer); 77 this.sidebarPanes.styles.setFilterBoxContainers(this._matchedStylesFilterBox Container, this._computedStylesFilterBoxContainer);
78 78
79 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane(); 79 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
80 this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); 80 this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
81 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this); 81 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this);
82 this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPan e(); 82 this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPan e();
83 this.sidebarPanes.animations = new WebInspector.AnimationsSidebarPane(this.s idebarPanes.styles);
83 84
84 this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventType s.wasShown, this.updateStyles.bind(this, false)); 85 this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventType s.wasShown, this.updateStyles.bind(this, false));
85 this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTyp es.wasShown, this.updateMetrics.bind(this)); 86 this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTyp es.wasShown, this.updateMetrics.bind(this));
86 this.sidebarPanes.platformFonts.addEventListener(WebInspector.SidebarPane.Ev entTypes.wasShown, this.updatePlatformFonts.bind(this)); 87 this.sidebarPanes.platformFonts.addEventListener(WebInspector.SidebarPane.Ev entTypes.wasShown, this.updatePlatformFonts.bind(this));
87 this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.Event Types.wasShown, this.updateProperties.bind(this)); 88 this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.Event Types.wasShown, this.updateProperties.bind(this));
88 this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.E ventTypes.wasShown, this.updateEventListeners.bind(this)); 89 this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.E ventTypes.wasShown, this.updateEventListeners.bind(this));
90 this.sidebarPanes.animations.addEventListener(WebInspector.SidebarPane.Event Types.wasShown, this.updateAnimations.bind(this));
89 91
90 this.sidebarPanes.styles.addEventListener("style edited", this._stylesPaneEd ited, this); 92 this.sidebarPanes.styles.addEventListener("style edited", this._stylesPaneEd ited, this);
91 this.sidebarPanes.styles.addEventListener("style property toggled", this._st ylesPaneEdited, this); 93 this.sidebarPanes.styles.addEventListener("style property toggled", this._st ylesPaneEdited, this);
92 this.sidebarPanes.metrics.addEventListener("metrics edited", this._metricsPa neEdited, this); 94 this.sidebarPanes.metrics.addEventListener("metrics edited", this._metricsPa neEdited, this);
93 this._extensionSidebarPanes = []; 95 this._extensionSidebarPanes = [];
94 96
95 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this)); 97 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this));
96 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this)); 98 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this));
97 this._dockSideChanged(); 99 this._dockSideChanged();
98 100
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 _updateSidebars: function() 295 _updateSidebars: function()
294 { 296 {
295 for (var pane in this.sidebarPanes) 297 for (var pane in this.sidebarPanes)
296 this.sidebarPanes[pane].needsUpdate = true; 298 this.sidebarPanes[pane].needsUpdate = true;
297 299
298 this.updateStyles(true); 300 this.updateStyles(true);
299 this.updateMetrics(); 301 this.updateMetrics();
300 this.updatePlatformFonts(); 302 this.updatePlatformFonts();
301 this.updateProperties(); 303 this.updateProperties();
302 this.updateEventListeners(); 304 this.updateEventListeners();
305 this.updateAnimations();
303 }, 306 },
304 307
305 _reset: function() 308 _reset: function()
306 { 309 {
307 delete this.currentQuery; 310 delete this.currentQuery;
308 }, 311 },
309 312
310 /** 313 /**
311 * @param {!WebInspector.Event} event 314 * @param {!WebInspector.Event} event
312 */ 315 */
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 updateEventListeners: function() 1129 updateEventListeners: function()
1127 { 1130 {
1128 var eventListenersSidebarPane = this.sidebarPanes.eventListeners; 1131 var eventListenersSidebarPane = this.sidebarPanes.eventListeners;
1129 if (!eventListenersSidebarPane.isShowing() || !eventListenersSidebarPane .needsUpdate) 1132 if (!eventListenersSidebarPane.isShowing() || !eventListenersSidebarPane .needsUpdate)
1130 return; 1133 return;
1131 1134
1132 eventListenersSidebarPane.update(this.selectedDOMNode()); 1135 eventListenersSidebarPane.update(this.selectedDOMNode());
1133 eventListenersSidebarPane.needsUpdate = false; 1136 eventListenersSidebarPane.needsUpdate = false;
1134 }, 1137 },
1135 1138
1139 updateAnimations: function()
1140 {
1141 var animationsSidebarPane = this.sidebarPanes.animations;
1142 if (!animationsSidebarPane.isShowing())
1143 return;
1144
1145 animationsSidebarPane.update(this.selectedDOMNode());
1146 },
1147
1136 /** 1148 /**
1137 * @param {!KeyboardEvent} event 1149 * @param {!KeyboardEvent} event
1138 */ 1150 */
1139 handleShortcut: function(event) 1151 handleShortcut: function(event)
1140 { 1152 {
1141 /** 1153 /**
1142 * @param {!WebInspector.ElementsTreeOutline} treeOutline 1154 * @param {!WebInspector.ElementsTreeOutline} treeOutline
1143 * @this {WebInspector.ElementsPanel} 1155 * @this {WebInspector.ElementsPanel}
1144 */ 1156 */
1145 function handleUndoRedo(treeOutline) 1157 function handleUndoRedo(treeOutline)
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 1420
1409 this.sidebarPanes.styles.show(matchedStylePanesWrapper); 1421 this.sidebarPanes.styles.show(matchedStylePanesWrapper);
1410 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper); 1422 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper);
1411 matchedStylePanesWrapper.appendChild(this.sidebarPanes.styles.titleEleme nt); 1423 matchedStylePanesWrapper.appendChild(this.sidebarPanes.styles.titleEleme nt);
1412 showMetrics.call(this, vertically); 1424 showMetrics.call(this, vertically);
1413 this.sidebarPanes.platformFonts.show(computedStylePanesWrapper); 1425 this.sidebarPanes.platformFonts.show(computedStylePanesWrapper);
1414 1426
1415 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners); 1427 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);
1416 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); 1428 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
1417 this.sidebarPaneView.addPane(this.sidebarPanes.properties); 1429 this.sidebarPaneView.addPane(this.sidebarPanes.properties);
1430 if (Runtime.experiments.isEnabled("animationInspection"))
1431 this.sidebarPaneView.addPane(this.sidebarPanes.animations);
1418 this._extensionSidebarPanesContainer = this.sidebarPaneView; 1432 this._extensionSidebarPanesContainer = this.sidebarPaneView;
1419 1433
1420 for (var i = 0; i < this._extensionSidebarPanes.length; ++i) 1434 for (var i = 0; i < this._extensionSidebarPanes.length; ++i)
1421 this._extensionSidebarPanesContainer.addPane(this._extensionSidebarP anes[i]); 1435 this._extensionSidebarPanesContainer.addPane(this._extensionSidebarP anes[i]);
1422 1436
1423 this.sidebarPaneView.show(this._splitView.sidebarElement()); 1437 this.sidebarPaneView.show(this._splitView.sidebarElement());
1424 this.sidebarPanes.styles.expand(); 1438 this.sidebarPanes.styles.expand();
1425 }, 1439 },
1426 1440
1427 /** 1441 /**
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 1545
1532 WebInspector.ElementsPanelFactory.prototype = { 1546 WebInspector.ElementsPanelFactory.prototype = {
1533 /** 1547 /**
1534 * @return {!WebInspector.Panel} 1548 * @return {!WebInspector.Panel}
1535 */ 1549 */
1536 createPanel: function() 1550 createPanel: function()
1537 { 1551 {
1538 return WebInspector.ElementsPanel.instance(); 1552 return WebInspector.ElementsPanel.instance();
1539 } 1553 }
1540 } 1554 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/AnimationsSidebarPane.js ('k') | Source/devtools/front_end/elements/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698