<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>240644</bug_id>
          
          <creation_ts>2022-05-19 05:55:27 -0700</creation_ts>
          <short_desc>Web Inspector: Computed Panel: Assertion Failed: Cannot remove view which isn&apos;t a subview. ComputedStyleSection</short_desc>
          <delta_ts>2022-05-19 14:50:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Razvan Caliman">rcaliman</reporter>
          <assigned_to name="Razvan Caliman">rcaliman</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1870342</commentid>
    <comment_count>0</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-05-19 05:55:27 -0700</bug_when>
    <thetext>```
[Error] Assertion Failed: Cannot remove view which isn&apos;t a subview.
ComputedStyleSection {_listeners: Multimap, _element: &lt;div class=&quot;computed-style-section&quot;&gt;, _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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870343</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-05-19 05:55:53 -0700</bug_when>
    <thetext>&lt;rdar://problem/93571902&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870379</commentid>
    <comment_count>2</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-05-19 08:12:24 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/782</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870535</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-05-19 14:50:45 -0700</bug_when>
    <thetext>Committed r294506 (250763@main): &lt;https://commits.webkit.org/250763@main&gt;

Reviewed commits have been landed. Closing PR #782 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>