Bug 233572 - Web Inspector: Computed Panel: Properties section should be hidden when the filter doesn't match
Summary: Web Inspector: Computed Panel: Properties section should be hidden when the f...
Status: RESOLVED DUPLICATE of bug 242704
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: 2021-11-29 10:14 PST by Razvan Caliman
Modified: 2022-08-19 08:21 PDT (History)
5 users (show)

See Also:


Attachments
Properties section header should be hidden (28.54 KB, image/png)
2021-11-29 10:14 PST, Razvan Caliman
no flags Details
Patch 1.0 (2.34 KB, patch)
2021-11-29 10:25 PST, Razvan Caliman
rcaliman: review?
Details | Formatted Diff | Diff
Computed panel with patch applied (26.63 KB, image/png)
2021-11-29 10:28 PST, Razvan Caliman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Razvan Caliman 2021-11-29 10:14:45 PST
Created attachment 445292 [details]
Properties section header should be hidden

When using the filter input field in the Computed panel, the Properties section header remains visible if there are no matches for the filter query. 
Variables section header is hidden as expected. 
See attached screenshot.
Comment 1 Radar WebKit Bug Importer 2021-11-29 10:15:20 PST
<rdar://problem/85822886>
Comment 2 Razvan Caliman 2021-11-29 10:25:09 PST
Created attachment 445295 [details]
Patch 1.0

Fix bug by bringing `WI.ComputedStyleSection.applyFilter()` to parity with
        `WI.SpreadsheetCSSStyleDeclarationEditor.applyFilter()`
Comment 3 Razvan Caliman 2021-11-29 10:28:05 PST
Created attachment 445297 [details]
Computed panel with patch applied

Properties and Variables section headers are hidden when there are no matches for the given filter input.
Comment 4 Patrick Angle 2021-11-29 11:37:53 PST
Comment on attachment 445295 [details]
Patch 1.0

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

> Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js:247
> +                if (this._hideFilterNonMatchingProperties)
> +                    this.element.append(propertyView.element);

This doesn't seem correct to me... Couldn't this cause property views to be out of order if they were previously filtered out but now aren't? The `this.needsLayout()` will undo this work anyways since `layout()` removes all the elements and re-adds them in the correct order.

> Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js:255
> +        this.dispatchEventToListeners(WI.ComputedStyleSection.Event.FilterApplied, {matches});

Could we instead just fire this event inside `layout()`with a `matches` determined during `layout()` instead and leave this function as-is?
Comment 5 Razvan Caliman 2022-08-19 08:21:28 PDT
Fixed as part of Bug 242704

*** This bug has been marked as a duplicate of bug 242704 ***