Bug 44736

Summary: Web Inspector: attribute nodes don't get rendered in the console
Product: WebKit Reporter: Ojan Vafai <ojan>
Component: Web Inspector (Deprecated)Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck, pfeldman, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
screenshot
none
[PATCH] Print Out Attributes
pfeldman: review+
[IMAGE] Results After Patch none

Description Ojan Vafai 2010-08-26 17:40:35 PDT
Created attachment 65652 [details]
screenshot

Type "document.createAttribute('id')" into the console. You get a blank line. You should get a node like any other node.
Comment 1 Joseph Pecoraro 2010-08-26 18:34:19 PDT
Thanks Ojan. Consider using the http://webkit.org/new-inspector-bug link, available
on the Bugzilla "New Bug" page https://bugs.webkit.org/enter_bug.cgi
Comment 2 Joseph Pecoraro 2010-08-26 18:58:52 PDT
Looks like we don't support just printing an attribute in
WebInspector.ElementsTreeElement.prototype._nodeTitleInfo.
It should be added. case Node.ATTRIBUTE_NODE is missing from that long switch.
http://trac.webkit.org/browser/trunk/WebCore/inspector/front-end/ElementsTreeOutline.js#L1253
Comment 3 Joseph Pecoraro 2010-08-26 21:05:44 PDT
Created attachment 65672 [details]
[PATCH] Print Out Attributes

Extends the console-format test to test for attributes. Image up soon.
Comment 4 Joseph Pecoraro 2010-08-26 21:06:07 PDT
Created attachment 65674 [details]
[IMAGE] Results After Patch
Comment 5 Pavel Feldman 2010-08-27 00:29:33 PDT
Comment on attachment 65672 [details]
[PATCH] Print Out Attributes

Thanks for the test with this.
Comment 6 Ojan Vafai 2010-08-27 09:05:20 PDT
This is definitely an improvement, but it seems to me that we'd want to output an object in the same way we do with Elements so that you can inspect the attribute object. Is that possible?
Comment 7 Pavel Feldman 2010-08-27 09:10:44 PDT
(In reply to comment #6)
> This is definitely an improvement, but it seems to me that we'd want to output an object in the same way we do with Elements so that you can inspect the attribute object. Is that possible?

I am not sure I understand the request. Could you clarify?
Comment 8 Joseph Pecoraro 2010-08-27 09:41:30 PDT
(In reply to comment #6)
> This is definitely an improvement, but it seems to me that we'd want to output
> an object in the same way we do with Elements so that you can inspect the
> attribute object. Is that possible?

What more is there to inspect? The name / value are the important parts. Is
there some more data we are missing?

Also, if you do want to view everything use dir(). That will force a listing as
an object tree, allowing you to see all properties / values / prototype chain.
Comment 9 Ojan Vafai 2010-08-27 13:51:49 PDT
Ugh. Nevermind me. I just wasn't thinking straight.
Comment 10 Joseph Pecoraro 2010-08-27 17:09:12 PDT
Committed r66282
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/ElementsTreeOutline.js
	M	WebCore/inspector/front-end/DOMAgent.js
	M	WebCore/inspector/InspectorDOMAgent.cpp
	M	LayoutTests/inspector/console-format-expected.txt
	M	LayoutTests/inspector/console-format.html
	M	LayoutTests/ChangeLog
r66282 = 67e7198a50637082bdc125592905a4afb8fdb9d1 (refs/remotes/trunk)
http://trac.webkit.org/changeset/66282