Closed
Bug 989629
Opened 10 years ago
Closed 10 years ago
Object Inspector should display class names for DOM elements
Categories
(DevTools :: Object Inspector, defect)
DevTools
Object Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 32
People
(Reporter: danemacmillan, Assigned: sjakthol)
Details
Attachments
(2 files, 2 obsolete files)
384.92 KB,
image/png
|
Details | |
4.93 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
Since bug 682033 comment 13, the output of nodes in the Console have included their class names. This is great. I think the side panel (when clicking to see the rest of the truncated results) that also displays NodeLists should include that information, too, otherwise it's not as useful, as discussed in the bug comment referenced. I think this is especially pertinent if the output of results in the Console do not have the cap on truncated collections (arrays, objects, NodeLists) increased or removed, via bug 989624.
Reporter | ||
Updated•10 years ago
|
Summary: Console's side panel does not order NodeList keys (numbers) naturally. → Console's side panel should also display class names for NodeLists.
Updated•10 years ago
|
Component: Developer Tools: Console → Developer Tools: Object Inspector
Summary: Console's side panel should also display class names for NodeLists. → Object Inspector should display class names for DOM elements
![]() |
Assignee | |
Comment 1•10 years ago
|
||
Here's a patch that adds class names to DOMNodes in variables view with the standard DOM selector convention. A DOM node might look like <div#id.class-one.class-two>. The patch also contains a test case to ensure the nodes are rendered correctly.
Attachment #8430547 -
Flags: review?(past)
![]() |
Assignee | |
Comment 2•10 years ago
|
||
The previous patch contained a little error. Here's a patch that calls the correct cleanup function in the attached test case.
Attachment #8430547 -
Attachment is obsolete: true
Attachment #8430547 -
Flags: review?(past)
Attachment #8430567 -
Flags: review?(past)
Comment 3•10 years ago
|
||
Comment on attachment 8430567 [details] [diff] [review] variablesview-show-element-classes.patch Review of attachment 8430567 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/shared/widgets/VariablesView.jsm @@ +3698,5 @@ > result += "#" + attrs.id; > } > + > + if (attrs.class) { > + result += "." + attrs.class.replace(" ", "."); This would properly match class="foo bar", but not class="foo bar". Better use class.replace(/\s+/, "."). Add another check in the test for this case, too. Looks good otherwise.
Attachment #8430567 -
Flags: review?(past)
![]() |
Assignee | |
Comment 4•10 years ago
|
||
That's a good point I didn't thought of. Thanks for the review. Here's a revised version of the patch with fix for the issue you pointed out.
Attachment #8430567 -
Attachment is obsolete: true
Attachment #8430948 -
Flags: review?(past)
Comment 5•10 years ago
|
||
Comment on attachment 8430948 [details] [diff] [review] variablesview-show-element-classes.patch Review of attachment 8430948 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the updated patch. Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=65925b7716f1
Attachment #8430948 -
Flags: review?(past) → review+
Updated•10 years ago
|
Assignee: nobody → sjakthol
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment 6•10 years ago
|
||
Landed: https://hg.mozilla.org/integration/fx-team/rev/767e7eb767d8
Whiteboard: [fixed-in-fx-team]
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/767e7eb767d8
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 32
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•