New issue
Advanced search Search tips

Issue 822328 link

Starred by 0 users

Issue metadata

Status: Verified
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-06-06
OS: iOS
Pri: 0
Type: Bug
Q2



Sign in to add a comment

Tab grid paging can be incorrect after device rotation.

Project Member Reported by marq@chromium.org, Mar 15 2018

Issue description

In RTL, the paging on the tab grid is incorrect.
 

Comment 2 by marq@chromium.org, Mar 15 2018

Cc: marq@chromium.org
Owner: edchin@chromium.org
Status: Assigned
Summary: Fix tab grid paging behavior in RTL (was: Fit & finish adjustments on the tab grid presentation animation)

Comment 3 by marq@chromium.org, Mar 15 2018

Components: UI>Localization UI>Browser>Mobile>TabSwitcher
Labels: -Type-Task Type-Bug

Comment 4 by edchin@chromium.org, Mar 17 2018

Why does this bug description say polish animation details. This should only be about the RTL fix. 

Comment 5 by edchin@chromium.org, Mar 17 2018

Notes:
The issue is in 2 places:
1) TabGridPageControl slider position only goes in LTR direction.
2) The currentPage calculation is only done in LTR order. 

Both issues are due to direct frame position access, which is not 
RTL friendly. 

The way to fix this is to check for RTL and flip the position. 
There are two ways to check for RTL. 
1) The Chrome approach is //base/i18n/rtl.h
2) The other is iOS idiomatic: https://developer.apple.com/documentation/uikit/uiview/1622480-userinterfacelayoutdirectionfors


Comment 6 by marq@chromium.org, Mar 19 2018

> 1) TabGridPageControl slider position only goes in LTR direction.

This is incorrect. Setting the slider position to 0 positions it at the leading side; setting it to 1 positions it at the trailing side. 

> The way to fix this is to check for RTL and flip the position. 

Generally speaking this is the last resort for RTL support in iOS Chrome. In this case (setting the contentOffset of the scroll view), layout constraints can't be used, but the utility functions in rtl_geometry.h (or an extension of them) should be.

Components: -UI>Localization
Labels: Needs-TestConfirmation
Hi All,

Thanks for reporting.
Removing UI>Localization from this bug. This is a localization issue.

Regards! 
Labels: -Pri-2 Pri-0
Project Member

Comment 9 by sheriffbot@chromium.org, Apr 10 2018

Pri-0 bugs are critical regressions or serious emergencies, and this bug has not been updated in three days. Could you please provide an update, or adjust the priority to a more appropriate level if applicable?

If a fix is in active development, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 10 by marq@chromium.org, Apr 16 2018

Labels: Disable-Nags

Comment 11 by marq@chromium.org, Apr 16 2018

Labels: Disable-Nags

Comment 12 by marq@chromium.org, Apr 17 2018

Description: Show this description

Comment 13 by marq@chromium.org, Apr 17 2018

Cc: -marq@chromium.org edchin@chromium.org
Labels: -medium small
Owner: marq@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 14 by bugdroid1@chromium.org, Apr 17 2018

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

commit cc989fc90f630fd86d7be24c4d9afdd415a736f3
Author: Mark Cogan <marq@google.com>
Date: Tue Apr 17 14:19:56 2018

[iOS] RTL paging fixes for Tab Grid.

Fix various paging isssues in RTL with the Tab Grid.

- Tapping the page control, or otherwise setting |currentPage| on the
  TabGridViewController will set the correct offset for the scroll view.

- Scrolling the view will set the correct page.

- Scrolling the view moves the page control correctly.

Bug:  822328 
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ic8f53c894fd4388b97d82093ac35ad675caa87a5
Reviewed-on: https://chromium-review.googlesource.com/1013927
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551317}
[modify] https://crrev.com/cc989fc90f630fd86d7be24c4d9afdd415a736f3/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm

Comment 15 by marq@chromium.org, Apr 17 2018

Status: Fixed (was: Started)
Status: Assigned (was: Fixed)
Tested in 68.0.3405.0 Canary, iPhone 7 iOS11.4 beta 2
In this scenario bug is still showing:
1. Launch app
2. Change device mode to landscape
3. Tap on tab switcher

Observe: In RTL, the paging on the tab grid is incorrect.
https://drive.google.com/file/d/1gz9MGiltso-DXV1ZxwxqnVryYBVy3-4C/view

Labels: Proj-UIRefresh

Comment 18 by marq@chromium.org, May 24 2018

NextAction: 2018-06-06
The NextAction date has arrived: 2018-06-06

Comment 20 by marq@chromium.org, Jun 8 2018

Summary: Tab grid paging can be incorrect after device rotation. (was: Fix tab grid paging behavior in RTL)
This actually isn't RTL-specific any more. If the device has rotated since the last time the tab grid was displayed (including on launch), the scroll position may be incorrect.

Comment 21 by marq@chromium.org, Jun 8 2018

Status: Started (was: Assigned)
Project Member

Comment 22 by bugdroid1@chromium.org, Jun 11 2018

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

commit b7f319368b344d61bb6c09f28f76c7fa45cfbe5a
Author: Mark Cogan <marq@google.com>
Date: Mon Jun 11 15:31:25 2018

[iOS] Correct scroll positioning when tab grid layout rotates.

This CL corrects situations where the tab grid may position its scroll
offset incorrectly when handling a size class transition.

The issue was that none of the call points for updating the scroll
position (via setting self.currentPage) were guaranteed to take place
after the scroll view's width had changed.

This CL moves some of those call points into -viewWillLayoutSubviews,
so that whenever the scroll view width changes it will be repositioned
correctly. Since this change should often not be animated, the
currentPage setter now doesn't animate by default, and a
-setCurrentPage:animated: method is available when animations are
needed.

Bug:  822328 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I36833314fc6d79d32cfddf9be8dacbeabc8ba4b9
Reviewed-on: https://chromium-review.googlesource.com/1093990
Reviewed-by: edchin <edchin@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566008}
[modify] https://crrev.com/b7f319368b344d61bb6c09f28f76c7fa45cfbe5a/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm

Comment 23 by marq@chromium.org, Jun 11 2018

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
Verified in 69.0.3464.0 Canary on iPhone8plus(iOS 11.4 beta), iPhone 7(iOS 10.3.3) and iPad Air(iOS 11.4 beta)

After device rotation tab grid paging looks good

Link to video:
https://drive.google.com/file/d/1vyPgDupamWua-TQfTGyf8dErbW7J9AQp/view?usp=sharing

Sign in to add a comment