https://bugs.webkit.org/show_bug.cgi?id=155732
Reviewed by Joseph Pecoraro.
The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
and avoiding work in the commit log viewer when the requested repository and the revision range were
the same as those of the last request.
* public/v3/components/commit-log-viewer.js:
(CommitLogViewer):
(CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
identical to the one we already have to avoid repaints and issuing multiple network requests.
* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
indicator hadn't changed.
* public/v3/pages/chart-pane.js:
(ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
the URL. We need to check whether the lock state had changed. The old condition was also redundant
since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@198518
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Commit log viewer repaints too frequently after r198499
+ https://bugs.webkit.org/show_bug.cgi?id=155732
+
+ Reviewed by Joseph Pecoraro.
+
+ The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
+ if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
+ and avoiding work in the commit log viewer when the requested repository and the revision range were
+ the same as those of the last request.
+
+ * public/v3/components/commit-log-viewer.js:
+ (CommitLogViewer):
+ (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
+ identical to the one we already have to avoid repaints and issuing multiple network requests.
+ * public/v3/components/interactive-time-series-chart.js:
+ (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
+ indicator hadn't changed.
+ * public/v3/pages/chart-pane.js:
+ (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
+ the URL. We need to check whether the lock state had changed. The old condition was also redundant
+ since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
+
2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
Fix A/B testing after r198503.
this._repository = null;
this._fetchingPromise = null;
this._commits = null;
+ this._from = null;
+ this._to = null;
}
currentRepository() { return this._repository; }
view(repository, from, to)
{
+ if (this._repository == repository && this._from == from && this._to == to)
+ return Promise.resolve(null);
+
this._commits = null;
+ this._repository = repository;
+ this._from = from;
+ this._to = to;
if (!repository) {
this._fetchingPromise = null;
return Promise.resolve(null);
}
- this._repository = repository;
-
if (!to) {
this._fetchingPromise = null;
this.render();
var oldIndicatorID = this._indicatorID;
- this._currentAnnotation = this._findAnnotation(cursorLocation);
+ var newAnnotation = this._findAnnotation(cursorLocation);
+ var newIndicatorID = null;
if (this._currentAnnotation)
- this._indicatorID = null;
+ newIndicatorID = null;
else
- this._indicatorID = this._findClosestPoint(cursorLocation);
+ newIndicatorID = this._findClosestPoint(cursorLocation);
this._forceRender = true;
+
+ if (this._currentAnnotation == newAnnotation && this._indicatorID == newIndicatorID)
+ return;
+
+ this._currentAnnotation = newAnnotation;
+ this._indicatorID = newIndicatorID;
+
this._notifyIndicatorChanged();
}
_indicatorDidChange(indicatorID, isLocked)
{
+ this._chartsPage.mainChartIndicatorDidChange(this, isLocked != this._mainChartIndicatorWasLocked);
this._mainChartIndicatorWasLocked = isLocked;
- this._chartsPage.mainChartIndicatorDidChange(this, isLocked || this._mainChartIndicatorWasLocked);
super._indicatorDidChange(indicatorID, isLocked);
}