Bug 155348 - Web Inspector: Make it possible to disable TimelineRuler UI
Summary: Web Inspector: Make it possible to disable TimelineRuler UI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks: 153672
  Show dependency treegraph
 
Reported: 2016-03-10 20:59 PST by Matt Baker
Modified: 2016-03-14 13:35 PDT (History)
8 users (show)

See Also:


Attachments
[Video] Disabled behavior (329.32 KB, video/mp4)
2016-03-10 21:02 PST, Matt Baker
no flags Details
[Patch] Proposed Fix (4.74 KB, patch)
2016-03-10 21:16 PST, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] Proposed Fix (4.67 KB, patch)
2016-03-11 09:36 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 =(.