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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js

Issue 2593893002: [Devtools] Fixes regression caused by experiment for network popover (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Network.NetworkWaterfallColumn = class extends UI.VBox { 7 Network.NetworkWaterfallColumn = class extends UI.VBox {
8 /** 8 /**
9 * @param {number} rowHeight 9 * @param {number} rowHeight
10 * @param {!Network.NetworkTimeCalculator} calculator 10 * @param {!Network.NetworkTimeCalculator} calculator
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 /** 76 /**
77 * @param {!Element} element 77 * @param {!Element} element
78 * @param {!Event} event 78 * @param {!Event} event
79 * @return {!AnchorBox|undefined} 79 * @return {!AnchorBox|undefined}
80 */ 80 */
81 _getPopoverAnchor(element, event) { 81 _getPopoverAnchor(element, event) {
82 if (!this._hoveredNode) 82 if (!this._hoveredNode)
83 return; 83 return;
84 var request = this._hoveredNode.request();
85 if (!request)
86 return;
84 var useTimingBars = !Common.moduleSetting('networkColorCodeResourceTypes').g et() && !this._calculator.startAtZero; 87 var useTimingBars = !Common.moduleSetting('networkColorCodeResourceTypes').g et() && !this._calculator.startAtZero;
85 if (useTimingBars) { 88 if (useTimingBars) {
86 var request = this._hoveredNode.request();
87 if (!request)
88 return;
89 var range = Network.RequestTimingView.calculateRequestTimeRanges(request, 0) 89 var range = Network.RequestTimingView.calculateRequestTimeRanges(request, 0)
90 .find(data => data.name === Network.RequestTimeRangeNames. Total); 90 .find(data => data.name === Network.RequestTimeRangeNames. Total);
91 var start = this._timeToPosition(range.start); 91 var start = this._timeToPosition(range.start);
92 var end = this._timeToPosition(range.end); 92 var end = this._timeToPosition(range.end);
93 } else { 93 } else {
94 var range = this._getSimplifiedBarRange(this.request(), 0); 94 var range = this._getSimplifiedBarRange(request, 0);
95 var start = range.start; 95 var start = range.start;
96 var end = range.end; 96 var end = range.end;
97 } 97 }
98 98
99 if (end - start < 50) { 99 if (end - start < 50) {
100 var halfWidth = (end - start) / 2; 100 var halfWidth = (end - start) / 2;
101 start = start + halfWidth - 25; 101 start = start + halfWidth - 25;
102 end = end - halfWidth + 25; 102 end = end - halfWidth + 25;
103 } 103 }
104 104
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 font: 'hsl(8, 100%, 80%)', 626 font: 'hsl(8, 100%, 80%)',
627 media: 'hsl(90, 50%, 80%)', 627 media: 'hsl(90, 50%, 80%)',
628 image: 'hsl(90, 50%, 80%)', 628 image: 'hsl(90, 50%, 80%)',
629 script: 'hsl(31, 100%, 80%)', 629 script: 'hsl(31, 100%, 80%)',
630 stylesheet: 'hsl(272, 64%, 80%)', 630 stylesheet: 'hsl(272, 64%, 80%)',
631 texttrack: 'hsl(8, 100%, 80%)', 631 texttrack: 'hsl(8, 100%, 80%)',
632 websocket: 'hsl(0, 0%, 95%)', 632 websocket: 'hsl(0, 0%, 95%)',
633 xhr: 'hsl(53, 100%, 80%)', 633 xhr: 'hsl(53, 100%, 80%)',
634 other: 'hsl(0, 0%, 95%)' 634 other: 'hsl(0, 0%, 95%)'
635 }; 635 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698