Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 2628533002: Fix tabs are not rendered properly when restore tabs after crash on iPad (Closed)

Created:
3 years, 11 months ago by liaoyuke
Modified:
3 years, 11 months ago
CC:
chromium-reviews, pkl (ping after 24h if needed), noyau+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix tabs are not rendered properly when restoring tabs after crash on iPad On iPad, tabs are only rendered within half of the tabs strip when restoring all tabs after the app crashed with four or more tabs open. Background: During tabs restoration, old tabs are inserted before the current tabs are removed, and after old tabs are inserted, the autoscroll amount of the tab strip view is calculated based on all tabs, then removing current tabs should not only remove the tabs, it is also expected to make sure that the autoscroll amount is updated correctly, and this is done by shifting the subviews by the amount of content offset that has changed before and after removing the tabs. The issue was happening because scrollRectToVisible with animation was called to calculate and set the autoscroll amount, however, scrollRectToVisible with animation is a lazy setter, which doesn't update the content offset of the tab strip view until animation has actually finished. Meanwhile, removing current tabs happened too soon, and to update the autoscroll amount, it referred to some out-of-date content offset, which finally resulted in the mess. This CL fixes the issue by changing from scrollRectToVisible with animation to setContentOffset to set autoscroll amount if newly inserted tab is the rightmost one, and this is because the tabs inserted during restoration are always at the rightmost position. BUG=679107 Review-Url: https://codereview.chromium.org/2628533002 Cr-Commit-Position: refs/heads/master@{#446042} Committed: https://chromium.googlesource.com/chromium/src/+/0a4e2e647f579fc30f46b88acd1a63fafeca9058

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed feedback #

Total comments: 6

Patch Set 3 : Addressed feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -35 lines) Patch
M ios/chrome/browser/ui/tabs/tab_strip_controller.mm View 1 2 5 chunks +68 lines, -35 lines 0 comments Download

Messages

Total messages: 23 (11 generated)
liaoyuke
Hi Rohit, Please take a look and let me know how you think about this ...
3 years, 11 months ago (2017-01-10 02:22:21 UTC) #2
liaoyuke
On 2017/01/10 02:22:21, liaoyuke wrote: > Hi Rohit, > > Please take a look and ...
3 years, 11 months ago (2017-01-11 17:30:42 UTC) #3
liaoyuke
On 2017/01/11 17:30:42, liaoyuke wrote: > On 2017/01/10 02:22:21, liaoyuke wrote: > > Hi Rohit, ...
3 years, 11 months ago (2017-01-17 05:13:44 UTC) #4
rohitrao (ping after 24h)
This new code will also fire whenever we create a new tab using the new ...
3 years, 11 months ago (2017-01-19 01:44:22 UTC) #7
rohitrao (ping after 24h)
Fixed a couple small typos in the CL description, but in general that was a ...
3 years, 11 months ago (2017-01-19 01:45:16 UTC) #8
liaoyuke
Than you very much for fixing the typos! PTAL. https://codereview.chromium.org/2628533002/diff/1/ios/chrome/browser/ui/tabs/tab_strip_controller.mm File ios/chrome/browser/ui/tabs/tab_strip_controller.mm (right): https://codereview.chromium.org/2628533002/diff/1/ios/chrome/browser/ui/tabs/tab_strip_controller.mm#newcode1266 ios/chrome/browser/ui/tabs/tab_strip_controller.mm:1266: ...
3 years, 11 months ago (2017-01-20 00:55:51 UTC) #9
rohitrao (ping after 24h)
lgtm When you tested performance, what device did you test on? https://codereview.chromium.org/2628533002/diff/20001/ios/chrome/browser/ui/tabs/tab_strip_controller.mm File ios/chrome/browser/ui/tabs/tab_strip_controller.mm (right): ...
3 years, 11 months ago (2017-01-24 14:19:24 UTC) #10
liaoyuke
On 2017/01/24 14:19:24, rohitrao wrote: > lgtm > > When you tested performance, what device ...
3 years, 11 months ago (2017-01-24 22:28:05 UTC) #11
liaoyuke
I've tested on two more devices in our cabinet, and I didn't see any noticeable ...
3 years, 11 months ago (2017-01-25 16:49:38 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2628533002/40001
3 years, 11 months ago (2017-01-25 16:50:03 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2628533002/60001
3 years, 11 months ago (2017-01-25 16:56:25 UTC) #20
commit-bot: I haz the power
3 years, 11 months ago (2017-01-25 17:08:18 UTC) #23
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/0a4e2e647f579fc30f46b88acd1a...

Powered by Google App Engine
This is Rietveld 408576698