Bug 133699 - Web Inspector: TypeError when hovering over "Show All Nodes" button in the Dom Tree inspector
Summary: Web Inspector: TypeError when hovering over "Show All Nodes" button in the Do...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jonathan Wells
Keywords: InRadar
Depends on:
Reported: 2014-06-10 14:27 PDT by Jonathan Wells
Modified: 2014-06-24 14:19 PDT (History)
7 users (show)

See Also:

Test case (9.68 KB, text/html)
2014-06-10 14:27 PDT, Jonathan Wells
no flags Details
[PATCH] Fix attempt. (1.70 KB, patch)
2014-06-23 19:34 PDT, Jonathan Wells
ggaren: review+
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 (579.30 KB, application/zip)
2014-06-23 21:06 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wells 2014-06-10 14:27:10 PDT
Created attachment 232815 [details]
Test case

Each mouseover throws this error:

[Error] TypeError: undefined is not a function (evaluating 'element._createTooltipForNode()')
	_onmousemove (DOMTreeOutline.js, line 313)
	(anonymous function) ([native code], line 0)

To reproduce, in the attached 501nodes.html file, inspect the dom and mouse over the "Show All Nodes" button below.
Comment 1 Radar WebKit Bug Importer 2014-06-10 14:27:22 PDT
Comment 2 Jonathan Wells 2014-06-23 19:34:42 PDT
Created attachment 233668 [details]
[PATCH] Fix attempt.
Comment 3 Build Bot 2014-06-23 21:06:12 PDT
Comment on attachment 233668 [details]
[PATCH] Fix attempt.

Attachment 233668 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4667063406690304

New failing tests:
Comment 4 Build Bot 2014-06-23 21:06:14 PDT
Created attachment 233675 [details]
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-15  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 5 Jonathan Wells 2014-06-23 23:44:52 PDT
This test failure is not caused by this patch.
Comment 6 Geoffrey Garen 2014-06-24 11:33:56 PDT
Comment on attachment 233668 [details]
[PATCH] Fix attempt.

View in context: https://bugs.webkit.org/attachment.cgi?id=233668&action=review

> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:313
> +            if (element.representedObject && !element.tooltip && element instanceof WebInspector.DOMTreeElement)
>                  element._createTooltipForNode();

I think it might be better just to test for the presence of the "_createTooltipForNode" property, instead of doing an instanceof check. This is basically a delegation protocol, and those usually work best when they are agnostic about the type of the target object, and only check whether the target object responds to the delegate function.
Comment 7 Geoffrey Garen 2014-06-24 11:36:34 PDT
Also, can you add a Web Inspector regression test to this patch?
Comment 8 Timothy Hatcher 2014-06-24 12:21:13 PDT
We don't have Web Inspector UI regression tests. We only have tests for the protocol and model layers.
Comment 9 Jonathan Wells 2014-06-24 14:19:20 PDT
Committed r170389: <https://trac.webkit.org/changeset/170389>