New issue
Advanced search Search tips

Issue 769998 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

DevTools: show names of non-Array, Array-subtypes: NodeList, DOMTokenList, HTMLAllCollection, etc

Project Member Reported by l...@chromium.org, Sep 28 2017

Issue description

Log any array-like object that isn't actually an Array: NodeList, DOMTokenList, HTMLAllCollection, RadioNodeList, Arguments, HTMLFormControlsCollection, HTMLOptionsCollection, HTMLCollection

Examples:
- document.body.childNodes
- document.all

In the DevTools console and across our UI, we format it as: '(5) [...]' when it should look like 'DOMTokenList(5) [...]'

We need to be better about checking for these cases and include their names.  Since there are so many, it might be better to hide the name only when the description starts with 'Array('
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24d150257c6dd561b8262fcd18f75bba88f285f3

commit 24d150257c6dd561b8262fcd18f75bba88f285f3
Author: Erik Luo <luoe@chromium.org>
Date: Tue Oct 03 00:19:55 2017

DevTools: show names of all formatted non-array array-subtypes

Objects such as 'NodeList', 'HTMLAllCollection', and 'Arguments' are all
'array'-subtype, and require the same formatting logic as normal arrays.

However, unlike normal Arrays, they should print their name as part of
their result. For example, 'NodeList(5) [...]' instead of '(5) [...]'.

Screenshot: https://imgur.com/a/I41jb

Bug:  769998 
Change-Id: I898e4e2be6c9a1bc5f05c341ab2bcc83e57deb2d
Reviewed-on: https://chromium-review.googlesource.com/691355
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505873}
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-collections-expected.txt
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-object-preview-expected.txt
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-save-to-temp-var-expected.txt
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/debugger-save-to-temp-var-expected.txt
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-expected.txt
[modify] https://crrev.com/24d150257c6dd561b8262fcd18f75bba88f285f3/third_party/WebKit/Source/devtools/front_end/object_ui/RemoteObjectPreviewFormatter.js

Comment 2 by l...@chromium.org, Oct 3 2017

Status: Fixed (was: Assigned)

Sign in to add a comment