Bug 237397 - Web Inspector: (Regression: r270134) [Timelines] CPU timeline details view is empty (and remains empty) if it was visible during an automatic recording on page load
Summary: Web Inspector: (Regression: r270134) [Timelines] CPU timeline details view is...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Patrick Angle
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-02 16:18 PST by Patrick Angle
Modified: 2022-03-02 17:36 PST (History)
4 users (show)

See Also:


Attachments
Patch v1.0 (5.07 KB, patch)
2022-03-02 16:32 PST, Patrick Angle
pangle: review?
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Angle 2022-03-02 16:18:24 PST
<rdar://89660755>
Comment 1 Patrick Angle 2022-03-02 16:32:02 PST
Created attachment 453675 [details]
Patch v1.0
Comment 2 Devin Rousso 2022-03-02 17:01:17 PST
Comment on attachment 453675 [details]
Patch v1.0

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

> Source/WebInspectorUI/ChangeLog:19
> +        This wasn't the case for the first recording's `CPUTimelineView  because it is already attached when it performs

If this is not a problem for `initialLayout`, then how does the `TimelineRuler` have bad values after that if the user hasn't navigated away from the `CPUTimelineView`?  This makes it sound like reloading the page somehow `detach` and then re-`attach` the `CPUTimelineView`.  I would hope that we're not doing that for a simple page reload.

> Source/WebInspectorUI/UserInterface/Views/View.js:37
> +        this._dirtyFromResize = false;

Rather than adding another property, maybe we make `_layoutReason` into a `Set` (or bitmap if we're concerned about memory) so that if more `WI.View.LayoutReason` are added (or custom ones like `WI.CPUTimelineView.LayoutReason.Internal` are used more frequently) then we don't have to add even more properties.  I think there's only a dozen or so uses of `this.layoutReason === ...` anyways, so changing those to `this.layoutReasons.has(...)` (or `this.layoutReasons & ...`) would probably be pretty simple.  Though we'd also probably wanna allow anything that previously only accepted a `layoutReason` to now accept a `layoutReasons` (i.e. `Set`) too.