Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.NetworkLogViewColumns = class { | 7 Network.NetworkLogViewColumns = class { |
| 8 /** | 8 /** |
| 9 * @param {!Network.NetworkLogView} networkLogView | 9 * @param {!Network.NetworkLogView} networkLogView |
| 10 * @param {!Network.NetworkTransferTimeCalculator} timeCalculator | 10 * @param {!Network.NetworkTransferTimeCalculator} timeCalculator |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 event.consume(true); | 166 event.consume(true); |
| 167 this._activeScroller.scrollTop -= event.wheelDeltaY; | 167 this._activeScroller.scrollTop -= event.wheelDeltaY; |
| 168 this._syncScrollers(); | 168 this._syncScrollers(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 _syncScrollers() { | 171 _syncScrollers() { |
| 172 if (!this._waterfallColumn.isShowing()) | 172 if (!this._waterfallColumn.isShowing()) |
| 173 return; | 173 return; |
| 174 this._waterfallScrollerContent.style.height = this._dataGridScroller.scrollH eight + 'px'; | 174 this._waterfallScrollerContent.style.height = this._dataGridScroller.scrollH eight + 'px'; |
| 175 this._updateScrollerWidthIfNeeded(); | 175 this._updateScrollerWidthIfNeeded(); |
| 176 this._dataGridScroller.scrollTop = this._waterfallScroller.scrollTop; | 176 var scrollDifference = this._dataGridScroller.scrollTop - this._waterfallScr oller.scrollTop; |
| 177 // Ensure we scroll by at least 3 px because of rounding. See: Element.proto type.isScrolledToBottom | |
| 178 if (Math.abs(scrollDifference) < 3) | |
| 179 scrollDifference = -3; | |
|
luoe
2017/01/25 17:07:06
If we check just based on scrollDifference, we may
allada
2017/01/25 22:38:54
Done.
| |
| 180 this._dataGridScroller.scrollTop -= scrollDifference; | |
| 177 } | 181 } |
| 178 | 182 |
| 179 _updateScrollerWidthIfNeeded() { | 183 _updateScrollerWidthIfNeeded() { |
| 180 if (this._waterfallScrollerWidthIsStale) { | 184 if (this._waterfallScrollerWidthIsStale) { |
| 181 this._waterfallScrollerWidthIsStale = false; | 185 this._waterfallScrollerWidthIsStale = false; |
| 182 this._waterfallColumn.setRightPadding( | 186 this._waterfallColumn.setRightPadding( |
| 183 this._waterfallScroller.offsetWidth - this._waterfallScrollerContent.o ffsetWidth); | 187 this._waterfallScroller.offsetWidth - this._waterfallScrollerContent.o ffsetWidth); |
| 184 } | 188 } |
| 185 } | 189 } |
| 186 | 190 |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 /** | 807 /** |
| 804 * @enum {string} | 808 * @enum {string} |
| 805 */ | 809 */ |
| 806 Network.NetworkLogViewColumns.WaterfallSortIds = { | 810 Network.NetworkLogViewColumns.WaterfallSortIds = { |
| 807 StartTime: 'startTime', | 811 StartTime: 'startTime', |
| 808 ResponseTime: 'responseReceivedTime', | 812 ResponseTime: 'responseReceivedTime', |
| 809 EndTime: 'endTime', | 813 EndTime: 'endTime', |
| 810 Duration: 'duration', | 814 Duration: 'duration', |
| 811 Latency: 'latency' | 815 Latency: 'latency' |
| 812 }; | 816 }; |
| OLD | NEW |