Bug 44736 - Web Inspector: attribute nodes don't get rendered in the console
Summary: Web Inspector: attribute nodes don't get rendered in the console
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 17:40 PDT by Ojan Vafai
Modified: 2010-08-27 17:09 PDT (History)
4 users (show)

See Also:


Attachments
screenshot (6.00 KB, image/png)
2010-08-26 17:40 PDT, Ojan Vafai
no flags Details
[PATCH] Print Out Attributes (11.53 KB, patch)
2010-08-26 21:05 PDT, Joseph Pecoraro
pfeldman: review+
Details | Formatted Diff | Diff
[IMAGE] Results After Patch (80.65 KB, image/png)
2010-08-26 21:06 PDT, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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