Bug 240805 - Web Inspector: Computed Panel: Move ungrouped CSS variables to dedicated DetailsSection
Summary: Web Inspector: Computed Panel: Move ungrouped CSS variables to dedicated Deta...
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: Razvan Caliman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-23 08:46 PDT by Razvan Caliman
Modified: 2022-05-25 08:45 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Razvan Caliman 2022-05-23 08:46:19 PDT
A follow-up from this comment https://github.com/WebKit/WebKit/pull/782#pullrequestreview-978824063 

> As an aside, it is unfortunate in hindsight that the variables section element can either directly contain variables for ungrouped mode, or contain sections. I wonder if there is a better way to handle this where we never have to even add the variables section to the map and instead have a single "section" within it (without a header) that behaves just like the grouped sections, but for ungrouped mode.

The top-level Variables details section contains either:
- the list of ungrouped variables
- nested detail sections for each group of variables by type

When toggling between grouping modes, we remove the host details sections for variable groups, but we need to take care not to remove the top-level Variables details section. This isn't ideal. All variable lists, ungrouped or grouped, need their own independent host details section that can be safely removed without impacting others.

A details section has a header with text and a button to toggle collapsing the section contents. Ungrouped variables don't need this. The top-level Variables details section serves this role (the reason why the code was written with it doing double duty).

We can change the implementation of `WI.DetailsSection` to not render a header if a title is not provided. This enables us to nest details sections without showing extraneous headers. This relieves `WI.ComputedStyleDetailsPanel.layout()` of the duty to avoid removing the top-level Variables details section.
Comment 1 Radar WebKit Bug Importer 2022-05-23 08:46:48 PDT
<rdar://problem/93761417>
Comment 2 Razvan Caliman 2022-05-23 09:05:09 PDT
Pull request: https://github.com/WebKit/WebKit/pull/920
Comment 3 EWS 2022-05-25 08:45:37 PDT
Committed r294800 (250956@main): <https://commits.webkit.org/250956@main>

Reviewed commits have been landed. Closing PR #920 and removing active labels.