OLD | NEW |
---|---|
1 /** | 1 /** |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 */ | 208 */ |
209 maxStackDepth: function() { }, | 209 maxStackDepth: function() { }, |
210 | 210 |
211 /** | 211 /** |
212 * @return {?WebInspector.FlameChart.TimelineData} | 212 * @return {?WebInspector.FlameChart.TimelineData} |
213 */ | 213 */ |
214 timelineData: function() { }, | 214 timelineData: function() { }, |
215 | 215 |
216 /** | 216 /** |
217 * @param {number} entryIndex | 217 * @param {number} entryIndex |
218 * @return {?Array.<!{title: string, value: (string|!Element)}>} | 218 * @return {?Element} |
219 */ | 219 */ |
220 prepareHighlightedEntryInfo: function(entryIndex) { }, | 220 prepareHighlightedEntryInfo: function(entryIndex) { }, |
221 | 221 |
222 /** | 222 /** |
223 * @param {number} entryIndex | 223 * @param {number} entryIndex |
224 * @return {boolean} | 224 * @return {boolean} |
225 */ | 225 */ |
226 canJumpToEntry: function(entryIndex) { }, | 226 canJumpToEntry: function(entryIndex) { }, |
227 | 227 |
228 /** | 228 /** |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
806 this._lastMouseOffsetX = -1; | 806 this._lastMouseOffsetX = -1; |
807 this._lastMouseOffsetY = -1; | 807 this._lastMouseOffsetY = -1; |
808 this.hideHighlight(); | 808 this.hideHighlight(); |
809 }, | 809 }, |
810 | 810 |
811 /** | 811 /** |
812 * @param {number} entryIndex | 812 * @param {number} entryIndex |
813 */ | 813 */ |
814 _updatePopover: function(entryIndex) | 814 _updatePopover: function(entryIndex) |
815 { | 815 { |
816 if (entryIndex !== this._highlightedEntryIndex) { | 816 if (entryIndex === this._highlightedEntryIndex) { |
alph
2016/09/08 01:37:46
You can revert this change.
| |
817 this._entryInfo.removeChildren(); | 817 this._updatePopoverOffset(); |
818 var entryInfo = this._dataProvider.prepareHighlightedEntryInfo(entry Index); | 818 return; |
819 if (entryInfo) | |
820 this._entryInfo.appendChild(this._buildEntryInfo(entryInfo)); | |
821 } | 819 } |
820 this._entryInfo.removeChildren(); | |
821 var popoverElement = this._dataProvider.prepareHighlightedEntryInfo(entr yIndex); | |
822 if (popoverElement) { | |
823 this._entryInfo.appendChild(popoverElement); | |
824 this._updatePopoverOffset(); | |
825 } | |
826 }, | |
827 | |
828 _updatePopoverOffset: function() | |
829 { | |
822 var mouseX = this._lastMouseOffsetX; | 830 var mouseX = this._lastMouseOffsetX; |
823 var mouseY = this._lastMouseOffsetY; | 831 var mouseY = this._lastMouseOffsetY; |
824 var parentWidth = this._entryInfo.parentElement.clientWidth; | 832 var parentWidth = this._entryInfo.parentElement.clientWidth; |
825 var parentHeight = this._entryInfo.parentElement.clientHeight; | 833 var parentHeight = this._entryInfo.parentElement.clientHeight; |
826 var infoWidth = this._entryInfo.clientWidth; | 834 var infoWidth = this._entryInfo.clientWidth; |
827 var infoHeight = this._entryInfo.clientHeight; | 835 var infoHeight = this._entryInfo.clientHeight; |
828 var /** @const */ offsetX = 10; | 836 var /** @const */ offsetX = 10; |
829 var /** @const */ offsetY = 6; | 837 var /** @const */ offsetY = 6; |
830 var x; | 838 var x; |
831 var y; | 839 var y; |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1835 /** | 1843 /** |
1836 * @param {number} level | 1844 * @param {number} level |
1837 * @return {number} | 1845 * @return {number} |
1838 */ | 1846 */ |
1839 _levelToHeight: function(level) | 1847 _levelToHeight: function(level) |
1840 { | 1848 { |
1841 return this._visibleLevelOffsets[level]; | 1849 return this._visibleLevelOffsets[level]; |
1842 }, | 1850 }, |
1843 | 1851 |
1844 /** | 1852 /** |
1845 * @param {!Array<!{title: string, value: (string|!Element)}>} entryInfo | |
1846 * @return {!Element} | |
1847 */ | |
1848 _buildEntryInfo: function(entryInfo) | |
1849 { | |
1850 var infoTable = createElementWithClass("table", "info-table"); | |
1851 for (var entry of entryInfo) { | |
1852 var row = infoTable.createChild("tr"); | |
1853 row.createChild("td", "title").textContent = entry.title; | |
1854 if (typeof entry.value === "string") | |
1855 row.createChild("td").textContent = entry.value; | |
1856 else | |
1857 row.createChild("td").appendChild(entry.value); | |
1858 } | |
1859 return infoTable; | |
1860 }, | |
1861 | |
1862 /** | |
1863 * @param {!CanvasRenderingContext2D} context | 1853 * @param {!CanvasRenderingContext2D} context |
1864 * @param {string} text | 1854 * @param {string} text |
1865 * @param {number} maxWidth | 1855 * @param {number} maxWidth |
1866 * @return {string} | 1856 * @return {string} |
1867 */ | 1857 */ |
1868 _prepareText: function(context, text, maxWidth) | 1858 _prepareText: function(context, text, maxWidth) |
1869 { | 1859 { |
1870 var /** @const */ maxLength = 200; | 1860 var /** @const */ maxLength = 200; |
1871 if (maxWidth <= 10) | 1861 if (maxWidth <= 10) |
1872 return ""; | 1862 return ""; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2020 this.update(); | 2010 this.update(); |
2021 }, | 2011 }, |
2022 | 2012 |
2023 _enabled: function() | 2013 _enabled: function() |
2024 { | 2014 { |
2025 return this._rawTimelineDataLength !== 0; | 2015 return this._rawTimelineDataLength !== 0; |
2026 }, | 2016 }, |
2027 | 2017 |
2028 __proto__: WebInspector.HBox.prototype | 2018 __proto__: WebInspector.HBox.prototype |
2029 } | 2019 } |
OLD | NEW |