Bug 143694 - Web Inspector: Indent top-level arrays, set, and maps differently from arrays, set, and maps inside objects
Summary: Web Inspector: Indent top-level arrays, set, and maps differently from arrays...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on: 143698
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-13 21:59 PDT by Nikita Vasilyev
Modified: 2016-12-13 15:38 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.19 KB, patch)
2015-04-16 19:23 PDT, Nikita Vasilyev
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-mavericks (530.40 KB, application/zip)
2015-04-16 19:57 PDT, Build Bot
no flags Details
[Image] Popovers with the patch applied (109.14 KB, image/png)
2015-04-16 21:08 PDT, Nikita Vasilyev
no flags Details
[IMAGE] Issues in Popover and Scopes Sidebar (245.37 KB, image/png)
2015-04-17 11:06 PDT, Joseph Pecoraro
no flags Details
Patch (2.59 KB, patch)
2015-04-18 21:01 PDT, Nikita Vasilyev
nvasilyev: review-
nvasilyev: commit-queue-
Details | Formatted Diff | Diff
[Image] Popovers with the patch applied 2 (102.95 KB, image/gif)
2015-04-18 21:02 PDT, Nikita Vasilyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Radar WebKit Bug Importer 2015-04-13 22:00:12 PDT
<rdar://problem/20530612>
Comment 2 Nikita Vasilyev 2015-04-15 01:18:14 PDT
WIP: http://n12v.com.s3.amazonaws.com/webkit-inspector/1/index.html

What do you think? Should I go ahead and submit the patch?

Note that it works in ToT WebKit, but not in Safari 8.0.5. It may take a while to load.

I grew tired rebuilding and restarting WebKit after every change, so I pulled HTML and CSS from the ToT inspector into a static page. It made tweaking CSS much more pleasant and, as a side-effect, easier to share where I’m at.
Comment 3 Timothy Hatcher 2015-04-16 10:34:43 PDT
Yes, please post a patch so we can see the changes involved. From previewing the HTML it looks good to me.
Comment 4 Nikita Vasilyev 2015-04-16 19:23:41 PDT
Created attachment 250988 [details]
Patch
Comment 5 Build Bot 2015-04-16 19:57:09 PDT
Comment on attachment 250988 [details]
Patch

Attachment 250988 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5354139441692672

New failing tests:
compositing/scrolling/touch-scroll-to-clip.html
Comment 6 Build Bot 2015-04-16 19:57:12 PDT
Created attachment 250997 [details]
Archive of layout-test-results from ews102 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 7 Nikita Vasilyev 2015-04-16 21:08:01 PDT
Created attachment 251000 [details]
[Image] Popovers with the patch applied
Comment 8 Timothy Hatcher 2015-04-17 06:57:30 PDT
Comment on attachment 250988 [details]
Patch

Looks fine to me. Joe, okay with you?
Comment 9 Joseph Pecoraro 2015-04-17 10:50:18 PDT
Comment on attachment 250988 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250988&action=review

Seeing as this special cases the Console and Popover. What do the default values look like in the Scopes sidebar or Node details sidebars?

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css:131
> +.console-message .object-tree.object-type-array > .object-tree-outline > .object-tree-array-index {
> +    left: -24px;
> +}

This file (ObjectTreeView.css) shouldn't include ".console-message" as ObjectTreeViews do not contain console messages. It should be in ConsoleMessageView.css, because it is about the console message view styling a object tree sub-component.

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css:143
> +.popover .object-tree.object-type-array > .object-tree-outline > .object-tree-array-index {
> +    left: -18px;
> +}

Likewise, these would need to be in Popover.css, or SourceCodeTextEditor.css.
Comment 10 Joseph Pecoraro 2015-04-17 11:05:32 PDT
After applying this patch, it looks like this doesn't handle the case of on Array within a Set in either the Scopes sidebar or Popovers. The Console did handle this correctly. See the image attachment.
Comment 11 Joseph Pecoraro 2015-04-17 11:06:56 PDT
Created attachment 251031 [details]
[IMAGE] Issues in Popover and Scopes Sidebar
Comment 12 Joseph Pecoraro 2015-04-17 11:09:48 PDT
Comment on attachment 250988 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250988&action=review

>> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css:131
>> +}
> 
> This file (ObjectTreeView.css) shouldn't include ".console-message" as ObjectTreeViews do not contain console messages. It should be in ConsoleMessageView.css, because it is about the console message view styling a object tree sub-component.

In fact it is weird to have to give custom styles to the console at all. What I would expect is:

  1. Object Tree styles handle proper indentation of indices at the top level and nested
  2. Console shouldn't need to make any adjustments
  3. Popovers can just shift the object-tree container over, without messing with the internals of ObjectTrees

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js:52
> +        this._element.classList.add("object-type-" + (object.subtype || object.type));

Which should make this unnecessary.

There is no doubt this looks better, but I think it goes about it in a very weird way, and as such it misses these cases.
Comment 13 Nikita Vasilyev 2015-04-18 21:01:44 PDT
Created attachment 251114 [details]
Patch

(In reply to comment #12)
> Comment on attachment 250988 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250988&action=review
> 
> >> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.css:131
> >> +}
> > 
> > This file (ObjectTreeView.css) shouldn't include ".console-message" as ObjectTreeViews do not contain console messages. It should be in ConsoleMessageView.css, because it is about the console message view styling a object tree sub-component.
> 
> In fact it is weird to have to give custom styles to the console at all.

Yes, I agree, but I couldn’t do it without them. Read below.

> What I would expect is:
> 
>   1. Object Tree styles handle proper indentation of indices at the top
> level and nested
>   2. Console shouldn't need to make any adjustments
>   3. Popovers can just shift the object-tree container over, without messing
> with the internals of ObjectTrees

I tried it, here is the patch.

Look at the objects outline – they need to be pulled on the left. I’d need to write at least one CSS rule specific for top-level objects inside of popups to fix it.
Comment 14 Nikita Vasilyev 2015-04-18 21:02:56 PDT
Created attachment 251115 [details]
[Image] Popovers with the patch applied 2