New issue
Advanced search Search tips

Issue 864601 link

Starred by 1 user

Issue metadata

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


Participants' hotlists:
Slim-Nav-Burndown


Sign in to add a comment

Tabs with chrome:// URLs don't have their titles updated correctly.

Project Member Reported by srikanthg@chromium.org, Jul 17

Issue description

App Version: 69.0.3494.0 canary
iOS Version: 12.0 beta#3, 11.4.1
Device: iPhoneX, iPhone6s, iPad Pro
URL: any

Steps to reproduce:
  1. Launch Google Chrome
  2. Navigate to any website say google.com
  3. Tap on Back arrow
  4. Enter TabSwitcher mode

Observed results: Observe that Tab cell title is displayed incorrectly with google.com title.

Expected results: Tab title should displayed correctly.

Number of times you were able to reproduce: 5/5
Bug reproducible after clean install: Yes
Bug reproducible after clearing cache and cookies: Yes
Bug reproducible on Chrome Mobile on Android: NA

Link to video/image: https://drive.google.com/file/d/1zIpzUxed_M_atQQvLsUvfn2-c1Mn2jcC/view
 
Labels: ReleaseBlock-Stable M-69
Owner: edchin@chromium.org
Status: Assigned (was: Untriaged)
edchin@ PTAL
Blockedon: 865074
Cc: pschaffner@chromium.org martijnb@chromium.org edchin@chromium.org
Labels: -ReleaseBlock-Stable Q2
Owner: marq@chromium.org
Related to another bug.
Labels: -Pri-1 -Q2 -M-69 Pri-2
This is mitigated by the fix for crbug/865074, but there's presumably an underlying problem that causes the title to not be updated. Leaving this bug open to track that.
Cc: marq@chromium.org
 Issue 865405  has been merged into this issue.
Blockedon: -865074
Labels: -Pri-2 M-69 Q2 Pri-1
Summary: Tabs with chrome:// URLs don't have their titles updated correctly. (was: NewTabPage title is not updated correctly in Tab Grid after navigation.)
Consolidating a couple of cases here:

(A) NTP -> navigate to some page P -> Back. Title is P's title, not the NTP title.
(B) some page P -> chrome://flags. Title is P's title, not "Chrome flags".
Cc: -pschaffner@chromium.org -edchin@chromium.org -martijnb@chromium.org
Labels: -Q2 -MS-Tab-Grid -Proj-UIRefresh ReleaseBlock-Stable Proj-WKBackForwardList
Owner: danyao@chromium.org
Just tested on canary 70.0.3500.0 and this only repros with Slim Navigation enabled. 

Removing the UI Refresh labels and assigning to danyao@
This sounds like a missing callback on the back navigation. marq@ can you give me some pointers on where tab titles are usually updated?
Also that the title of the tab itself is correct, only the title in the tab switcher is wrong. The bug also only affects UI Refresh. So this seems to me that the tab switcher must be caching the title somewhere.
marq@: correct me if I am wrong. The TabGrid is observing the WebState for title changes: https://cs.chromium.org/chromium/src/ios/chrome/browser/ui/tab_grid/tab_grid_mediator.mm?dr=C&q=webStateDidChangeTitle&sq=package:chromium&g=0&l=213 . This is not called when navigating to chrome://flags or other chrome://... URLs. Maybe it is because of the way the native content navigation is handled? For example, the path that leads to this callback for non-native page has a !IsPlaceholderUrl() https://cs.chromium.org/chromium/src/ios/web/web_state/ui/crw_web_controller.mm?type=cs&q=IsPlaceholderUrl&sq=package:chromium&g=0&l=5209

I don't know how it is working in non-UI refresh.
|-webViewTitleDidChange| wouldn't have been called for native content in LegacyNavigationManager. I think the bug is in the early exit in |-setNavigationItemTitle|: https://cs.chromium.org/chromium/src/ios/web/web_state/ui/crw_web_controller.mm?type=cs&q=setNavigationItemTitle&l=1294
The WebStateImpl->OnTitleChanged() should not be skipped just because the navigation item has the right title, because the last committed navigation item title would have changed.

I can reproduce the bug on debug 69.0.3495.0 with legacy navigation manager as well. I'll send out a fix.
Status: Started (was: Assigned)
I think non-UI refresh might be getting title directly from WebState->GetTitle() instead of caching a copy of title. So it wasn't affected by missing OnTitleChanged() callbacks.
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 25

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

commit 352492fdd7794a1c7672bee0e081764a667ebd9b
Author: Danyao Wang <danyao@chromium.org>
Date: Wed Jul 25 17:49:51 2018

[ios] Always notify WebStateObservers on navigation item title change.

The short circuit skips WebStateImpl->OnTitleChanged() incorrectly on
back/forward navigation because although the title in the navigation
item doesn't need changing, the visible navigation item has changed.

This only affects navigating to native content from web content because
web state title for web content is updated separately in
|-webViewTitleDidChange|.

Bug:  864601 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ifd74f87aff0276394def154a8410b3dd1ce6c1c8
Reviewed-on: https://chromium-review.googlesource.com/1148693
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577967}
[modify] https://crrev.com/352492fdd7794a1c7672bee0e081764a667ebd9b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm
[modify] https://crrev.com/352492fdd7794a1c7672bee0e081764a667ebd9b/ios/web/web_state/ui/crw_web_controller.mm
[modify] https://crrev.com/352492fdd7794a1c7672bee0e081764a667ebd9b/ios/web/web_state/ui/crw_web_controller_unittest.mm

Status: Fixed (was: Started)
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-69; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-69 label, otherwise remove Merge-TBD label. Thanks.
Labels: -Merge-TBD Merge-Request-69
Project Member

Comment 17 by sheriffbot@chromium.org, Jul 26

Labels: -Merge-Request-69 Hotlist-Merge-Approved Merge-Approved-69
Your change meets the bar and is auto-approved for M69. Please go ahead and merge the CL to branch 3497 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

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

Comment 18 by bugdroid1@chromium.org, Jul 26

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d78cff10f1e65c15190851d1148dcdbdf3b85e6

commit 0d78cff10f1e65c15190851d1148dcdbdf3b85e6
Author: Danyao Wang <danyao@chromium.org>
Date: Thu Jul 26 19:24:16 2018

[ios] Always notify WebStateObservers on navigation item title change.

Cherry-pick for M69 (refs/branch-heads/3497).

The short circuit skips WebStateImpl->OnTitleChanged() incorrectly on
back/forward navigation because although the title in the navigation
item doesn't need changing, the visible navigation item has changed.

This only affects navigating to native content from web content because
web state title for web content is updated separately in
|-webViewTitleDidChange|.

Bug:  864601 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ifd74f87aff0276394def154a8410b3dd1ce6c1c8
Reviewed-on: https://chromium-review.googlesource.com/1148693
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577967}(cherry picked from commit 352492fdd7794a1c7672bee0e081764a667ebd9b)
Reviewed-on: https://chromium-review.googlesource.com/1151914
Reviewed-by: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#123}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/0d78cff10f1e65c15190851d1148dcdbdf3b85e6/ios/web/web_state/navigation_and_load_callbacks_inttest.mm
[modify] https://crrev.com/0d78cff10f1e65c15190851d1148dcdbdf3b85e6/ios/web/web_state/ui/crw_web_controller.mm
[modify] https://crrev.com/0d78cff10f1e65c15190851d1148dcdbdf3b85e6/ios/web/web_state/ui/crw_web_controller_unittest.mm

Status: Verified (was: Fixed)
Verified on iPhoneX , iPad Pro
iOS11.4.1, 12.0 beta#5

Tap title is displayed correctly in tab switcher.
Verified with enabling the flag slim-navigation-manager.
Verified in 69.0.3497.22 Beta in iPhone 7plus(iOS 10.3.3), iPhone 8plus(iOS 12 beta5) and iPad Air(iOS 11.4.1)

Tap title is displayed correctly in tab switcher on following the steps mentioned in comment#5

Sign in to add a comment