New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 679107 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug

Blocking:
issue 678709



Sign in to add a comment

Tabs are only rendered within half of the tab strip after crash and restore all tabs.

Project Member Reported by liaoyuke@chromium.org, Jan 7 2017

Issue description

on iPad in portrait mode...

- open 4 tabs, select the second to last one
- crash the application
- restart chrome and restore all tabs by clicking on the button in info bar.

expected:

- tabs should be rendered as if crash never happened.

actual:

- tabs are only rendered within the left half of the tab strip view.
 
Labels: -Restrict-View-Google
Status: Fixed (was: Started)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a4e2e647f579fc30f46b88acd1a63fafeca9058

commit 0a4e2e647f579fc30f46b88acd1a63fafeca9058
Author: liaoyuke <liaoyuke@chromium.org>
Date: Wed Jan 25 17:07:40 2017

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}

[modify] https://crrev.com/0a4e2e647f579fc30f46b88acd1a63fafeca9058/ios/chrome/browser/ui/tabs/tab_strip_controller.mm

Status: Verified (was: Fixed)
Verified in 58.0.2998.0 canary, iPhone 6+ iOS 10.2, iPad mini 10.1

Tabs are rendered as if crash never happened.

Sign in to add a comment