RESOLVED WONTFIX160335
Web Inspector: Expanding a sidebar causes two tab browser layouts
https://bugs.webkit.org/show_bug.cgi?id=160335
Summary Web Inspector: Expanding a sidebar causes two tab browser layouts
Matt Baker
Reported 2016-07-29 01:15:30 PDT
Summary: Expanding a sidebar causes two tab browser layouts. Collapsing a sidebar correctly causes a single layout.
Attachments
[Patch] Proposed Fix (2.72 KB, patch)
2016-07-29 01:26 PDT, Matt Baker
beidson: review-
Radar WebKit Bug Importer
Comment 1 2016-07-29 01:15:45 PDT
Matt Baker
Comment 2 2016-07-29 01:26:10 PDT
Created attachment 284853 [details] [Patch] Proposed Fix
Blaze Burg
Comment 3 2016-07-29 10:23:02 PDT
Comment on attachment 284853 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=284853&action=review > Source/WebInspectorUI/ChangeLog:11 > + WidthDidChange event should only fire once. Where does the other call to _recalculateWidth come from? > Source/WebInspectorUI/UserInterface/Views/Sidebar.js:280 > + if (!suppressWidthDidChange) This seems like the wrong fix, it's overly fragile and the caller needs to know when a second call might happen. Shouldn't we just bail early if the newWidth is the same as the old width?
Blaze Burg
Comment 4 2016-07-29 10:24:04 PDT
It would also be good to explain the performance implications, is this extra layout showing up in profiles when expanding and collapsing sidebars?
Matt Baker
Comment 5 2016-07-29 18:41:41 PDT
Comment on attachment 284853 [details] [Patch] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=284853&action=review >> Source/WebInspectorUI/ChangeLog:11 >> + WidthDidChange event should only fire once. > > Where does the other call to _recalculateWidth come from? It's only called once. The other WidthDidChange occurs at the end of the "collapsed" setter. >> Source/WebInspectorUI/UserInterface/Views/Sidebar.js:280 >> + if (!suppressWidthDidChange) > > This seems like the wrong fix, it's overly fragile and the caller needs to know when a second call might happen. Shouldn't we just bail early if the newWidth is the same as the old width? It's also overly complicated. Since _recalculateWidth is only called when the sidebar is expanded, we just need to do this at the end: if (this._collapsed) this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange);
Matt Baker
Comment 6 2016-07-29 18:42:36 PDT
(In reply to comment #4) > It would also be good to explain the performance implications, is this extra > layout showing up in profiles when expanding and collapsing sidebars? Didn't check, I just noticed the double layout while debugging another view issue.
Matt Baker
Comment 7 2016-07-29 18:52:56 PDT
And it's all moot now that we no longer recalculate the width on expand: https://bugs.webkit.org/show_bug.cgi?id=159646.
Brady Eidson
Comment 8 2017-08-19 16:03:05 PDT
Comment on attachment 284853 [details] [Patch] Proposed Fix r-, as this has been pending review for over a year now. It is near-impossible that this patch still applies to trunk and unlikely to still be relevant in its current form.
Note You need to log in before you can comment on or make changes to this bug.