<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression: Web Inspector: Sometimes in Elements panel two elements showed as selected at the same time"
   href="https://bugs.webkit.org/show_bug.cgi?id=149742#c10">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression: Web Inspector: Sometimes in Elements panel two elements showed as selected at the same time"
   href="https://bugs.webkit.org/show_bug.cgi?id=149742">bug 149742</a>
              from <span class="vcard"><a class="email" href="mailto:joepeck&#64;webkit.org" title="Joseph Pecoraro &lt;joepeck&#64;webkit.org&gt;"> <span class="fn">Joseph Pecoraro</span></a>
</span></b>
        <pre><span class="quote">&gt; However I'm marking as cq- because I still fail to see how this was caused
&gt; by r187496, which means there is something I don't yet fully understand
&gt; here, so I want to investigate this a bit more.</span >

I now understand!

The same optimization that I'm adding to moveChild(...) effectively happened before. While iterating over the child list the old code would skip over tree elements in the correct place:

<span class="quote">&gt;    while (child) {
&gt;        var currentTreeElement = treeElement.children[treeChildIndex];
&gt;        if (!currentTreeElement || currentTreeElement.representedObject !== child) {
&gt;            ...
&gt;        }
&gt;        ...
&gt;    }</span >


Basically we now do that first check in moveChild(...). The old code could presumably have a bug that this addresses with the correct selecting.

Either way, I'm now confident that this can land.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>