Web Inspector: Reduce unnecessary forced layouts in TimelineRuler
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jan 2016 06:46:56 +0000 (06:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jan 2016 06:46:56 +0000 (06:46 +0000)
commitbea6c2adf91d0253397062a41fed2a1e0eae58b4
tree292ed021f2f2f60c60aa506f491cd3d9b09443a0
parentd4f1253c1551dd03a53f861433167160929bd090
Web Inspector: Reduce unnecessary forced layouts in TimelineRuler
https://bugs.webkit.org/show_bug.cgi?id=153390
<rdar://problem/24312241>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-22
Reviewed by Timothy Hatcher.

TimelineRuler's width rarely changes. It should only need to calculate
its width when added to the DOM or if the content view containing it
has resized and the bounds of the ruler may have changed.

Switch everything in TimelineRuler to using a cached width, and add
an explicit method, resize, to update this width. This eliminated
frequent hangs I was seeing while recording timelines.

* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype.shown):
(WebInspector.OverviewTimelineView.prototype.updateLayoutForResize):
Resize the ruler when the view is shown or resized.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype.shown):
(WebInspector.TimelineOverview.prototype.updateLayoutForResize):
Resize the ruler when the view is shown or resized.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype.layout):
Inform the current content view of a resize if possible.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.resize):
Update the width.

(WebInspector.TimelineRuler.prototype._recalculate):
(WebInspector.TimelineRuler.prototype._needsMarkerLayout):
(WebInspector.TimelineRuler.prototype._needsSelectionLayout):
(WebInspector.TimelineRuler.prototype._handleMouseMove):
(WebInspector.TimelineRuler.prototype._handleSelectionHandleMouseMove):
Use cached width.

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.createCombinedBars): Deleted.
Remove some stale code.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js
Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js
Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js
Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js