Bug 151057

Summary: Web Inspector: Convert sidebars to use View base class
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Patch] Proposed Fix
none
[Patch] Proposed Fix none

Description Matt Baker 2015-11-09 15:38:26 PST
* SUMMARY
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
<rdar://problem/23472088>
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;

Nice!
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.