Bug 240644 - Web Inspector: Computed Panel: Assertion Failed: Cannot remove view which isn't a subview. ComputedStyleSection
Summary: Web Inspector: Computed Panel: Assertion Failed: Cannot remove view which isn...
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-19 05:55 PDT by Razvan Caliman
Modified: 2022-05-19 14:50 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-19 05:55:27 PDT
```
[Error] Assertion Failed: Cannot remove view which isn't a subview.
ComputedStyleSection {_listeners: Multimap, _element: <div class="computed-style-section">, _parentView: null, _subviews: [], _dirty: false, …}
	removeSubview (View.js:127)
	layout (ComputedStyleDetailsPanel.js:216)
	_layoutSubtree (View.js:308)
	_layoutSubtree (View.js:319)
	_layoutSubtree (View.js:319)
	_visitViewTreeForLayout (View.js:378)
```

The root cause of this failed assertion is an accumulation of orphaned `WI.ComputedStyleSection` instances in `this._detailsSectionByStyleSectionMap` from `WI.ComputedStyleDetailsPanel`. 

When `WI.ComputedStyleDetailsPanel.layout()` is called to reflect the latest selected node's variables, the previous `WI.ComputedStyleSection` view instance for ungrouped variables is accidentally kept around even though its host DOM node was removed. When attempting to remove this view on the next `layout()` run, this orphaned instance has no host node that belongs to the parent view so the assertion is hit. The issue gets progressively worse on each `layout()` run by accumulating more orphans.
Comment 1 Radar WebKit Bug Importer 2022-05-19 05:55:53 PDT
<rdar://problem/93571902>
Comment 2 Razvan Caliman 2022-05-19 08:12:24 PDT
Pull request: https://github.com/WebKit/WebKit/pull/782
Comment 3 EWS 2022-05-19 14:50:45 PDT
Committed r294506 (250763@main): <https://commits.webkit.org/250763@main>

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