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

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

Issue 2466633002: [Devtools] Fixed scrollers for new timeline canvas on mac (Closed)
Patch Set: Created 4 years, 1 month 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 741c7d4dd20c41c1328436d21393b97615da0ff8..d019055db0251b56c867eb38f8b98e3bbaf656ea 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
@@ -17,6 +17,7 @@ WebInspector.NetworkTimelineColumn = function(rowHeight, calculator)
this._canvas = this.contentElement.createChild("canvas");
this._canvas.tabIndex = 1;
this.setDefaultFocusedElement(this._canvas);
+ this._canvasPosition = this._canvas.getBoundingClientRect();
/** @const */
this._leftPadding = 5;
@@ -100,14 +101,14 @@ WebInspector.NetworkTimelineColumn.prototype = {
var start = this._timeToPosition(range.start);
var end = this._timeToPosition(range.end);
- if (event.offsetX < start || event.offsetX > end)
+ if (event.clientX < this._canvasPosition.left + start || event.clientX > this._canvasPosition.left + end)
return;
var rowIndex = this._requestData.findIndex(request => this._hoveredRequest === request);
var barHeight = this._getBarHeight(range.name);
var y = this._headerHeight + (this._rowHeight * rowIndex - this._scrollTop) + ((this._rowHeight - barHeight) / 2);
- if (event.offsetY < y || event.offsetY > y + barHeight)
+ if (event.clientY < this._canvasPosition.top + y || event.clientY > this._canvasPosition.top + y + barHeight)
return;
var anchorBox = this.element.boxInWindow();
@@ -237,6 +238,7 @@ WebInspector.NetworkTimelineColumn.prototype = {
{
this._offsetWidth = this.contentElement.offsetWidth - this._rightPadding;
this._offsetHeight = this.contentElement.offsetHeight;
+ this._canvasPosition = this._canvas.getBoundingClientRect();
},
/**
« 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