Changeset 203920 in webkit


Ignore:
Timestamp:
Jul 29, 2016 1:43:42 PM (8 years ago)
Author:
Matt Baker
Message:

Web Inspector: Inactive/active network bar segments overlap when latency is zero
https://bugs.webkit.org/show_bug.cgi?id=160147
<rdar://problem/27516007>

Reviewed by Joseph Pecoraro.

TimelineRecordBar should hide the inactive segment when its duration
is less than the minimum displayable size. The active segment can
assume the whole width of the bar.

  • UserInterface/Views/TimelineOverviewGraph.js:

(WebInspector.TimelineOverviewGraph.prototype.get secondsPerPixel):
Make secondsPerPixel available during TimelineRecordBars.refresh.

  • UserInterface/Views/TimelineRecordBar.js:

(WebInspector.TimelineRecordBar.prototype.refresh):
Check inactive duration against the minimum display size,
and add/remove DOM nodes and bar styles as needed.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r203912 r203920  
     12016-07-29  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Inactive/active network bar segments overlap when latency is zero
     4        https://bugs.webkit.org/show_bug.cgi?id=160147
     5        <rdar://problem/27516007>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        TimelineRecordBar should hide the inactive segment when its duration
     10        is less than the minimum displayable size. The active segment can
     11        assume the whole width of the bar.
     12
     13        * UserInterface/Views/TimelineOverviewGraph.js:
     14        (WebInspector.TimelineOverviewGraph.prototype.get secondsPerPixel):
     15        Make secondsPerPixel available during TimelineRecordBars.refresh.
     16
     17        * UserInterface/Views/TimelineRecordBar.js:
     18        (WebInspector.TimelineRecordBar.prototype.refresh):
     19        Check inactive duration against the minimum display size,
     20        and add/remove DOM nodes and bar styles as needed.
     21
    1222016-07-29  Nikita Vasilyev  <nvasilyev@apple.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js

    r200767 r203920  
    149149    }
    150150
     151    get secondsPerPixel() { return this._timelineOverview.secondsPerPixel; }
     152
    151153    get visible()
    152154    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js

    r201231 r203920  
    226226    refresh(graphDataSource)
    227227    {
     228        console.assert(graphDataSource.zeroTime);
     229        console.assert(graphDataSource.startTime);
     230        console.assert(graphDataSource.currentTime);
     231        console.assert(graphDataSource.endTime);
     232        console.assert(graphDataSource.secondsPerPixel);
     233
    228234        if (!this._records || !this._records.length)
    229235            return false;
     
    304310        if (inactiveUnfinished)
    305311            barActiveStartTime = graphCurrentTime;
    306 
    307         var middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
    308 
    309         if (this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
     312        else if (this._renderMode === WebInspector.TimelineRecordBar.RenderMode.Normal) {
     313            // Hide the inactive segment when its duration is less than the minimum displayable size.
     314            let minimumSegmentDuration = graphDataSource.secondsPerPixel * WebInspector.TimelineRecordBar.MinimumWidthPixels;
     315            if (barActiveStartTime - barStartTime < minimumSegmentDuration) {
     316                barActiveStartTime = barStartTime;
     317                if (this._inactiveBarElement)
     318                    this._inactiveBarElement.remove();
     319            }
     320        }
     321
     322        let showInactiveSegment = barActiveStartTime > barStartTime;
     323        this._element.classList.toggle("has-inactive-segment", showInactiveSegment);
     324
     325        let middlePercentage = (barActiveStartTime - barStartTime) / barDuration;
     326        if (showInactiveSegment && this._renderMode !== WebInspector.TimelineRecordBar.RenderMode.ActiveOnly) {
    310327            if (!this._inactiveBarElement) {
    311328                this._inactiveBarElement = document.createElement("div");
Note: See TracChangeset for help on using the changeset viewer.