[webkit-reviews] review granted: [Bug 175999] Web Inspector: Critical content browser toolbar buttons are hidden at narrow widths : [Attachment 319203] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 29 17:16:53 PDT 2017
Devin Rousso <webkit at devinrousso.com> has granted Matt Baker
<mattbaker at apple.com>'s request for review:
Bug 175999: Web Inspector: Critical content browser toolbar buttons are hidden
at narrow widths
https://bugs.webkit.org/show_bug.cgi?id=175999
Attachment 319203: Patch
https://bugs.webkit.org/attachment.cgi?id=319203&action=review
--- Comment #11 from Devin Rousso <webkit at devinrousso.com> ---
Comment on attachment 319203
--> https://bugs.webkit.org/attachment.cgi?id=319203
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=319203&action=review
r=me, with a few minor comments
> Source/WebInspectorUI/UserInterface/Views/GroupNavigationItem.js:40
> + this._navigationItems = [];
> +
> + for (let item of navigationItems) {
> + console.assert(item instanceof WI.NavigationItem);
> + this.element.appendChild(item.element);
> + this._navigationItems.push(item);
> + }
Instead of adding each item to _navigationItems, why not just set them equal
and then loop over _navigationItems?
this._navigationItems = navigationItems;
for (let item of this._navigationItems) {
console.assert(item instanceof WI.NavigationItem);
this.element.appendChild(item.element);
}
> Source/WebInspectorUI/UserInterface/Views/GroupNavigationItem.js:42
> +
// Public
> Source/WebInspectorUI/UserInterface/Views/GroupNavigationItem.js:48
> + get navigationItems() { return this._navigationItems; }
NIT: I'd put this above minimumWidth(), as it's a one-line getter.
> Source/WebInspectorUI/UserInterface/Views/GroupNavigationItem.js:52
> + updateLayout(expandOnly)
I realize that this function already existed, but it's very confusing because
this doesn't subclass View :(
> Source/WebInspectorUI/UserInterface/Views/GroupNavigationItem.js:70
> + super.didDetach();
Were you going to move this?
> Source/WebInspectorUI/UserInterface/Views/NavigationBar.js:433
> + const totalItemWidth = this._visibleNavigationItems.reduce((total,
item) => item.minimumWidth, 0);
Style: this value changes per invocation, so it should be `let`.
More information about the webkit-reviews
mailing list