Title: [294506] trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js
- Revision
- 294506
- Author
- [email protected]
- Date
- 2022-05-19 14:49:47 -0700 (Thu, 19 May 2022)
Log Message
Web Inspector: Computed Panel: Assertion Failed: Cannot remove view which isn't a subview. ComputedStyleSection
https://bugs.webkit.org/show_bug.cgi?id=240644
Reviewed by Patrick Angle.
The root cause for this failed assertion is an accumulation of orphaned `WI.ComputedStyleSection` view instances in
`WI.ComputedStyleDetailsPanel._detailsSectionByStyleSectionMap`.
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. 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 fails. The issue gets progressively worse on each `layout()` run by accumulating more orphans.
* Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js: (WI.ComputedStyleDetailsPanel.prototype.layout):
Canonical link: https://commits.webkit.org/250763@main
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js (294505 => 294506)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js 2022-05-19 21:44:28 UTC (rev 294505)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js 2022-05-19 21:49:47 UTC (rev 294506)
@@ -215,13 +215,11 @@
this.element.appendChild(styleSection.element);
this.removeSubview(styleSection);
styleSection.element.remove();
+ this._detailsSectionByStyleSectionMap.delete(styleSection);
// The top-level details section for variables needs to be preserved because it's the host of nested details sections for variables groups.
- if (detailsSection === this._variablesSection)
- continue;
-
- detailsSection.element.remove();
- this._detailsSectionByStyleSectionMap.delete(styleSection);
+ if (detailsSection !== this._variablesSection)
+ detailsSection.element.remove();
}
this._variablesStyleSectionForGroupTypeMap.clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes