Bug 125709 - Web Inspector: refactor TimelineDecorations into TimelineRuler
Summary: Web Inspector: refactor TimelineDecorations into TimelineRuler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-12-13 13:35 PST by Timothy Hatcher
Modified: 2014-01-20 19:02 PST (History)
4 users (show)

See Also:


Attachments
Patch (33.85 KB, patch)
2013-12-13 14:06 PST, Timothy Hatcher
joepeck: review+
timothy: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2013-12-13 13:35:38 PST
The current TimelineDecorations class needs beefed up to support new use cases in Timeline. Mainly scrollable times that isn't always starting at 0. We also need to support time scales that don't have an end time, but are specified in seconds per pixel.
Comment 1 Timothy Hatcher 2013-12-13 14:06:26 PST
Created attachment 219196 [details]
Patch
Comment 2 Joseph Pecoraro 2013-12-13 14:50:27 PST
Comment on attachment 219196 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219196&action=review

r=me

> Source/WebInspectorUI/UserInterface/TimelineRuler.js:46
> +    this._allowsClippedLabels = false;

I would include "this._endTimePinned = false" up here with the list of other member variables that don't get `delete`d.

> Source/WebInspectorUI/UserInterface/TimelineRuler.js:165
> +        return this._secondsPerPixel;

Should this _recalculate before returning a value? Someone could call _needsLayout, but that only updates this member variable after a rAF. So if someone set endTime then checked secondsPerPixel it could be wrong.

> Source/WebInspectorUI/UserInterface/TimelineRuler.js:248
> +            var newLeftPosition = ((dividerTime - this._startTime) / duration);

Style: unnecessary extra parens

> Source/WebInspectorUI/UserInterface/TimelineRuler.js:254
> +                    removeDividerAndSelectNext();
> +                    continue;

Is it necessary to remove divider and select next? Why not just continue, and keep to reuse the current divider? Extra dividers are removed after this loop anyways (lines 284-285).

> Source/WebInspectorUI/UserInterface/TimelineRuler.js:264
> +                    removeDividerAndSelectNext();
> +                    continue;

Ditto.
Comment 3 Timothy Hatcher 2014-01-20 19:02:25 PST
https://trac.webkit.org/changeset/162407
Comment 4 Radar WebKit Bug Importer 2014-01-20 19:02:40 PST
<rdar://problem/15866316>