Bug 133699

Summary: Web Inspector: TypeError when hovering over "Show All Nodes" button in the Dom Tree inspector
Product: WebKit Reporter: Jonathan Wells <jonowells>
Component: Web InspectorAssignee: Jonathan Wells <jonowells>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, ggaren, graouts, joepeck, rniwa, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test case
none
[PATCH] Fix attempt.
ggaren: review+
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 none

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
<rdar://problem/17257874>
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:
media/W3C/video/networkState/networkState_during_loadstart.html
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>