Bug 151057 - Web Inspector: Convert sidebars to use View base class
Summary: Web Inspector: Convert sidebars to use View base class
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
Keywords: InRadar
Depends on:
Reported: 2015-11-09 15:38 PST by Matt Baker
Modified: 2015-11-11 14:57 PST (History)
8 users (show)

See Also:

[Patch] Proposed Fix (22.16 KB, patch)
2015-11-10 20:16 PST, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] Proposed Fix (22.07 KB, patch)
2015-11-11 14:08 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2015-11-09 15:38:26 PST
Convert sidebars to use View base class, make details section a first-class concept. It would be nice to be able to write this.addDetailsSection(detailsSection) instead of this.element.appendChild(this._myDetailsSection.element), from within sidebar classes.
Comment 1 Radar WebKit Bug Importer 2015-11-09 15:38:41 PST
Comment 2 Matt Baker 2015-11-10 20:14:35 PST
To reduce the scope of this patch, improvements to sidebar details sections will be tracked under a separate issue: https://bugs.webkit.org/show_bug.cgi?id=151126.
Comment 3 Matt Baker 2015-11-10 20:16:58 PST
Created attachment 265262 [details]
[Patch] Proposed Fix
Comment 4 Timothy Hatcher 2015-11-10 20:31:58 PST
Comment on attachment 265262 [details]
[Patch] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/Sidebar.js:203
> +        this._collapsed = flag;

flag || false;

> Source/WebInspectorUI/UserInterface/Views/Sidebar.js:205
> +            this.element.classList.add(WebInspector.Sidebar.CollapsedStyleClassName);

These lines can be replaced with classList.toggle().

> Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js:75
> +        this._selected = flag;

flag || false;

> Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js:76
> +        this.element.classList.toggle("selected");

Would be safer to pass _selected as the second argument to toggle.

> Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js:81
> +        return this.parentView;

Comment 5 Matt Baker 2015-11-11 14:08:18 PST
Created attachment 265317 [details]
[Patch] Proposed Fix
Comment 6 WebKit Commit Bot 2015-11-11 14:57:41 PST
Comment on attachment 265317 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 265317

Committed r192327: <http://trac.webkit.org/changeset/192327>
Comment 7 WebKit Commit Bot 2015-11-11 14:57:45 PST
All reviewed patches have been landed.  Closing bug.