Changeset 275337 in webkit


Ignore:
Timestamp:
Mar 31, 2021 7:02:47 PM (16 months ago)
Author:
Patrick Angle
Message:

Web Inspector: Regression (r270134) Timeline recordings 2 and beyond do not show a timescale.
https://bugs.webkit.org/show_bug.cgi?id=222930

Reviewed by Devin Rousso.

When a new TimelineOverview is created, it calls TimelineOverview.prototype._viewModeDidChange inside the
constructor, which in turn called updateLayout. This was problematic in that a TimelineRuler would have
sizeDidChange invoked before it was attached to the DOM, which meant that there was no width to cache. Because
sizeDidChange is only invoked during the first layout and on resize events, the cached width is not updated
when the ruler is attached to the view hierarchy, having already performed an early initial layout.

This patch now checks if the TimelineOverview has performed its initial layout before updating the layout
inside _viewModeDidChange, which means that the initial layout on the child TimelineRuler will be done while
attached, thus producing a valid width value to cache.

  • UserInterface/Views/TimelineOverview.js:

(WI.TimelineRuler.prototype._viewModeDidChange):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r275310 r275337  
     12021-03-31  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: Regression (r270134) Timeline recordings 2 and beyond do not show a timescale.
     4        https://bugs.webkit.org/show_bug.cgi?id=222930
     5
     6        Reviewed by Devin Rousso.
     7
     8        When a new `TimelineOverview` is created, it calls `TimelineOverview.prototype._viewModeDidChange` inside the
     9        constructor, which in turn called `updateLayout`. This was problematic in that a `TimelineRuler` would have
     10        `sizeDidChange` invoked before it was attached to the DOM, which meant that there was no width to cache. Because
     11        `sizeDidChange` is only invoked during the first layout and on resize events, the cached width is not updated
     12        when the ruler is attached to the view hierarchy, having already performed an early initial layout.
     13
     14        This patch now checks if the `TimelineOverview` has performed its initial layout before updating the layout
     15        inside `_viewModeDidChange`, which means that the initial layout on the child `TimelineRuler` will be done while
     16        attached, thus producing a valid width value to cache.
     17
     18        * UserInterface/Views/TimelineOverview.js:
     19        (WI.TimelineRuler.prototype._viewModeDidChange):
     20
    1212021-03-31  Nikita Vasilyev  <nvasilyev@apple.com>
    222
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js

    r270134 r275337  
    854854        this.element.classList.toggle("frames", isRenderingFramesMode);
    855855
    856         this.updateLayout(WI.View.LayoutReason.Resize);
     856        if (this.didInitialLayout)
     857            this.updateLayout(WI.View.LayoutReason.Resize);
    857858    }
    858859
Note: See TracChangeset for help on using the changeset viewer.