Bug 155348

Summary: Web Inspector: Make it possible to disable TimelineRuler UI
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 153672    
Attachments:
Description Flags
[Video] Disabled behavior
none
[Patch] Proposed Fix
none
[Patch] Proposed Fix none

Description Matt Baker 2016-03-10 20:59:35 PST
* SUMMARY
Make it possible to disable TimelineRuler UI. Disabling the ruler should lock the current selection, and hide the selection handles to emphasize the non-editable state.

* NOTE
If allowsTimeRangeSelection is false, setting disabled = true would have no effect.
Comment 1 Radar WebKit Bug Importer 2016-03-10 20:59:49 PST
<rdar://problem/25103505>
Comment 2 Matt Baker 2016-03-10 21:02:39 PST
Created attachment 273680 [details]
[Video] Disabled behavior

Double-click disables the ruler for demo purposes only. In the real world this would be set programmatically.
Comment 3 Matt Baker 2016-03-10 21:16:07 PST
Created attachment 273682 [details]
[Patch] Proposed Fix
Comment 4 Timothy Hatcher 2016-03-10 23:34:41 PST
Comment on attachment 273682 [details]
[Patch] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:727
> -        this.element.style.pointerEvents = "all";
> +        this.element.style.pointerEvents = pointerEvents;

This could be changed to: delete this.element.style.pointerEvents or this.element.style.pointerEvents = null;
Comment 5 Matt Baker 2016-03-11 09:31:46 PST
(In reply to comment #4)
> Comment on attachment 273682 [details]
> [Patch] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=273682&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:727
> > -        this.element.style.pointerEvents = "all";
> > +        this.element.style.pointerEvents = pointerEvents;
> 
> This could be changed to: delete this.element.style.pointerEvents or
> this.element.style.pointerEvents = null;

Both methods results in "" being returned by `this.element.style.pointerEvents`, so I'll go with " = null".
Comment 6 Matt Baker 2016-03-11 09:36:45 PST
Created attachment 273737 [details]
[Patch] Proposed Fix
Comment 7 WebKit Commit Bot 2016-03-11 10:30:01 PST
Comment on attachment 273737 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 273737

Committed r198026: <http://trac.webkit.org/changeset/198026>
Comment 8 WebKit Commit Bot 2016-03-11 10:30:04 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Joseph Pecoraro 2016-03-14 13:35:05 PDT
Comment on attachment 273737 [details]
[Patch] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:722
> -        if (this._mouseMoved)
> +        if (!this._enabled)
> +            return;
> +
> +        if (!this._mouseMoved)
>              return;

This flipped the condition of the mouseMoved check =(.