Fix tabs sometimes being min size after exiting fullscreen.
While the tabstrip is not visible, TabStripRegionView has zero width. If any model change happens while the tabstrip is not visible, the tabstrip calculates the ideal bounds for tabs based on this available width. The bug was that the tabstrip was ignoring the first layout after being restored to visibility because it believed that its cached layout was still up-to-date. I.e. this was the timeline: Layout() at width and available width 1340. Enter fullscreen. Available width is now -78. Insert a tab. Ideal bounds are as small as possible to fit -78 width. Exit fullscreen. Available width is now 1340. Layout() at width and available width 1340. Layout() is ignored because there's been no change in width or available width, when in fact the ideal bounds are stale. This wasn't happening pre-suspect change because it was calling Layout() while TabStripRegionView's width was zero (since it called Layout() to calculate the available width for calculating ideal bounds), so the first layout after the size was normal again went through. The fix I went with was to update |last_available_width_| whenever ideal bounds are calculated. This more correctly reflects the current calculated layout's dependency on available width. Bug: 1132832 Change-Id: I5487a99bceb7267cab1e00e2163ba86e2a93b0ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438774 Commit-Queue: Taylor Bergquist <tbergquist@chromium.org> Reviewed-by:Charlene Yan <cyan@chromium.org> Cr-Commit-Position: refs/heads/master@{#812290}
Showing
Please register or sign in to comment