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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js

Issue 2438683004: [Devtools] Fixed scrollbar offset in new timeline experiment (Closed)
Patch Set: Merge branch 'NETWORK_TIMELINE_10_ADD_COLOR_NAVIGATION' into NETWORK_TIMELINE_11_FIX_SCROLLBAR Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/networkTimelineColumn.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
index 359b0e6ebe15170ac6831e10ce0f1d4da272bcdf..e3c3b422ee38cdf5892c142b6bbf6f1ff05eea8b 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
@@ -36,7 +36,7 @@ WebInspector.NetworkTimelineColumn = function(rowHeight, headerHeight, calculato
this._vScrollElement = this.contentElement.createChild("div", "network-timeline-v-scroll");
this._vScrollElement.addEventListener("scroll", this._onScroll.bind(this), { passive: true });
this._vScrollElement.addEventListener("mousewheel", this._onMouseWheel.bind(this), { passive: true });
- this._vScrollContent = this._vScrollElement.createChild("div");
+ this._vScrollContent = this._vScrollElement.createChild("div", "network-timeline-v-scroll-content");
this.element.addEventListener("mousewheel", this._onMouseWheel.bind(this), { passive: true });
this.element.addEventListener("mousemove", this._onMouseMove.bind(this), true);
@@ -177,6 +177,7 @@ WebInspector.NetworkTimelineColumn.prototype = {
setHeaderHeight: function(height)
{
this._headerHeight = height;
+ this._vScrollElement.style.marginTop = height + "px";
},
/**
@@ -244,6 +245,7 @@ WebInspector.NetworkTimelineColumn.prototype = {
if (requestData) {
this._requestData = requestData.requests;
this._navigationRequest = requestData.navigationRequest;
+ this._calculateCanvasSize();
}
this.element.window().cancelAnimationFrame(this._updateRequestID);
this._updateRequestID = null;
@@ -277,11 +279,20 @@ WebInspector.NetworkTimelineColumn.prototype = {
onResize: function()
{
WebInspector.VBox.prototype.onResize.call(this);
- this._offsetWidth = this.contentElement.offsetWidth;
- this._offsetHeight = this.contentElement.offsetHeight;
+ this._calculateCanvasSize();
this.scheduleDraw();
},
+ _calculateCanvasSize: function()
+ {
+ var scrollbarWidth = this._vScrollElement.offsetWidth;
+ // Offset by 1 px because css needs 1px to compute height and add scrollbar.
+ if (scrollbarWidth)
+ scrollbarWidth -= 1;
+ this._offsetWidth = this.contentElement.offsetWidth - scrollbarWidth;
+ this._offsetHeight = this.contentElement.offsetHeight;
+ },
+
/**
* @param {!WebInspector.RequestTimeRangeNames} type
* @return {string}
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/networkTimelineColumn.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698