Fixes a regression where TreeOutline.findTreeElement would
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2008 02:46:58 +0000 (02:46 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2008 02:46:58 +0000 (02:46 +0000)
        return the parent TreeElement of the representedObject instead
        of the TreeElement for the representedObject. Regressed with the
        fix for bug 19164.

        Reviewed by Adam Roben.

        * page/inspector/treeoutline.js:
        (TreeOutline.prototype.findTreeElement): When performing a slow search,
        do a final search for representedObject instead of returning item, which
        is the parent of representedObject.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/inspector/treeoutline.js

index 7d772ec..4207b95 100644 (file)
@@ -1,3 +1,17 @@
+2008-07-21  Timothy Hatcher  <timothy@apple.com>
+
+        Fixes a regression where TreeOutline.findTreeElement would
+        return the parent TreeElement of the representedObject instead
+        of the TreeElement for the representedObject. Regressed with the
+        fix for bug 19164.
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/treeoutline.js:
+        (TreeOutline.prototype.findTreeElement): When performing a slow search,
+        do a final search for representedObject instead of returning item, which
+        is the parent of representedObject.
+
 2008-07-23  Adele Peterson  <adele@apple.com>
 
         Reviewed by Adam.
index 5f3cdb5..5df0f7d 100644 (file)
@@ -295,7 +295,9 @@ TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor,
             item.onpopulate(item);
     }
 
-    return item;
+    // Now that all the ancestors are populated, try to find the representedObject again. This time
+    // without the isAncestor and getParent functions to prevent an infinite recursion if it isn't found.
+    return this.findTreeElement(representedObject);
 }
 
 TreeOutline.prototype.treeElementFromPoint = function(x, y)