New issue
Advanced search Search tips

Issue 898358 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 24
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

didLoadPageWIthSuccess not called when navigating to chrome://newtab

Project Member Reported by justincohen@chromium.org, Oct 24

Issue description

Is this intentional? It's breaking item->GetPageDisplayState scroll restoration.
 
Components: -Mobile>iOSWebView Mobile>WebView>Glue
By didLoadPageWIthSuccess do you mean WebStateObserver::PageLoaded and it's Objective-C version webState:didLoadPageWithSuccess:? 

WebStateObserver::PageLoaded should be called for NativeContent and we have test which verifies that 
(WebStateObserverTest, NativeContentNavigation). If the method is not called - it's a bug.

What does "It's breaking item->GetPageDisplayState scroll restoration" mean? Is there a user facing bug which breaks scroll restoration for NTP? 
Cc: eugene...@chromium.org
Owner: ----
Status: Unconfirmed (was: Untriaged)
Below is a stack trace for WebStateObserver::OnPageLoaded call for chrome://newtab. Justin, could you please update the bug with specific steps to reproduce and information how the bug affect the user. Thanks!


* thread #1, name = 'CrWebMain', queue = 'com.apple.main-thread', stop reason = breakpoint 12.1
  * frame #0: 0x000000010c5982ab Chromium`web::WebStateObserverBridge::PageLoaded(this=0x00006000025c30c0, web_state=0x00007fadc4d59aa0, load_completion_status=SUCCESS) at web_state_observer_bridge.mm:83
    frame #1: 0x000000010c583c4d Chromium`web::WebStateImpl::OnPageLoaded(this=0x00007fadc4d59aa0, url=0x00007ffee4924838, load_success=true) at web_state_impl.mm:270
    frame #2: 0x000000010c46b24b Chromium`::-[CRWWebController didFinishWithURL:loadSuccess:context:](self=0x00007fadc4d59cf0, _cmd="didFinishWithURL:loadSuccess:context:", currentURL=0x00007ffee4924838, loadSuccess=YES, context=0x0000600001cff8e0) at crw_web_controller.mm:2196
    frame #3: 0x000000010c466a8c Chromium`::-[CRWWebController didLoadNativeContentForNavigationItem:](self=0x00007fadc4d59cf0, _cmd="didLoadNativeContentForNavigationItem:", item=0x00007fadc50d9a00) at crw_web_controller.mm:1851
    frame #4: 0x000000010c466458 Chromium`::-[CRWWebController loadCurrentURLInNativeView](self=0x00007fadc4d59cf0, _cmd="loadCurrentURLInNativeView") at crw_web_controller.mm:1810
    frame #5: 0x000000010c468748 Chromium`::-[CRWWebController loadCurrentURL](self=0x00007fadc4d59cf0, _cmd="loadCurrentURL") at crw_web_controller.mm:1972
    frame #6: 0x000000010c468aa6 Chromium`::-[CRWWebController loadCurrentURLIfNecessary](self=0x00007fadc4d59cf0, _cmd="loadCurrentURLIfNecessary") at crw_web_controller.mm:1996
    frame #7: 0x000000010c58b2f4 Chromium`web::WebStateImpl::LoadIfNecessary(this=0x00007fadc4d59aa0) at web_state_impl.mm:824
    frame #8: 0x000000010c3b02da Chromium`web::NavigationManagerImpl::LoadIfNecessary(this=0x0000600003dfcb40) at navigation_manager_impl.mm:398
    frame #9: 0x000000010cfc052e Chromium`WebStateListWebUsageEnablerImpl::UpdateWebUsageForAddedWebState(this=0x00006000027b7400, web_state=0x00007fadc4d59aa0) at web_state_list_web_usage_enabler_impl.mm:64
    frame #10: 0x000000010cfc058c Chromium`WebStateListWebUsageEnablerImpl::WebStateInsertedAt(this=0x00006000027b7400, web_state_list=0x00006000010c6470, web_state=0x00007fadc4d59aa0, index=0, activating=true) at web_state_list_web_usage_enabler_impl.mm:76
    frame #11: 0x000000010ca22a5d Chromium`WebStateList::InsertWebState(this=0x00006000010c6470, index=0, web_state=unique_ptr<web::WebState, std::__1::default_delete<web::WebState> > @ 0x00007ffee49258c8, insertion_flags=3, opener=WebStateOpener @ 0x00007ffee49257c8) at web_state_list.mm:188
    frame #12: 0x000000010d945d48 Chromium`::-[TabModel insertTabWithLoadParams:opener:openedByDOM:atIndex:inBackground:](self=0x00007fadc4e1ac70, _cmd="insertTabWithLoadParams:opener:openedByDOM:atIndex:inBackground:", loadParams=0x00007ffee49260f8, parentTab=0x0000000000000000, openedByDOM=NO, index=0, inBackground=NO) at tab_model.mm:538
    frame #13: 0x000000010d4d38d0 Chromium`::-[BrowserViewController addSelectedTabWithURL:postData:atIndex:transition:tabAddedCompletion:](self=0x00007fadc6062000, _cmd="addSelectedTabWithURL:postData:atIndex:transition:tabAddedCompletion:", URL=0x00007ffee4926580, postData=0x0000000000000000, position=0, transition=PAGE_TRANSITION_TYPED, tabAddedCompletion=(null)) at browser_view_controller.mm:2893
    frame #14: 0x000000010d4bf870 Chromium`::-[BrowserViewController addSelectedTabWithURL:atIndex:transition:tabAddedCompletion:](self=0x00007fadc6062000, _cmd="addSelectedTabWithURL:atIndex:transition:tabAddedCompletion:", url=0x00007ffee4926580, position=0, transition=PAGE_TRANSITION_TYPED, tabAddedCompletion=(null)) at browser_view_controller.mm:1461
    frame #15: 0x000000010d4bf804 Chromium`::-[BrowserViewController addSelectedTabWithURL:atIndex:transition:](self=0x00007fadc6062000, _cmd="addSelectedTabWithURL:atIndex:transition:", url=0x00007ffee4926580, position=0, transition=PAGE_TRANSITION_TYPED) at browser_view_controller.mm:1451
    frame #16: 0x000000010d4bf7a0 Chromium`::-[BrowserViewController addSelectedTabWithURL:transition:](self=0x00007fadc6062000, _cmd="addSelectedTabWithURL:transition:", url=0x00007ffee4926580, transition=PAGE_TRANSITION_TYPED) at browser_view_controller.mm:1443
    frame #17: 0x000000010d4bf376 Chromium`::-[BrowserViewController openNewTabFromOriginPoint:focusOmnibox:](self=0x00007fadc6062000, _cmd="openNewTabFromOriginPoint:focusOmnibox:", originPoint=(x = 0, y = 0), focusOmnibox=NO) at browser_view_controller.mm:1437
    frame #18: 0x000000010b2e5d2a Chromium`::-[MainController openURLInNewTab:](self=0x00007fadc4c06850, _cmd="openURLInNewTab:", command=0x00007fadc4d582a0) at main_controller.mm:1527
    frame #19: 0x000000010b2e35d7 Chromium`::-[MainController createInitialUI:](self=0x00007fadc4c06850, _cmd="createInitialUI:", launchMode=NORMAL) at main_controller.mm:1306
    frame #20: 0x000000010b2de615 Chromium`::-[MainController startUpBrowserForegroundInitialization](self=0x00007fadc4c06850, _cmd="startUpBrowserForegroundInitialization") at main_controller.mm:770
    frame #21: 0x000000010b2dc9c4 Chromium`::-[MainController startUpBrowserToStage:](self=0x00007fadc4c06850, _cmd="startUpBrowserToStage:", stage=INITIALIZATION_STAGE_FOREGROUND) at main_controller.mm:614
    frame #22: 0x000000010cb8055e Chromium`::-[AppState initializeUI](self=0x00006000004fcd20, _cmd="initializeUI") at app_state.mm:482
    frame #23: 0x000000010cb7fc26 Chromium`::-[AppState requiresHandlingAfterLaunchWithOptions:stateBackground:](self=0x00006000004fcd20, _cmd="requiresHandlingAfterLaunchWithOptions:stateBackground:", launchOptions=0x0000000000000000, stateBackground=NO) at app_state.mm:435
    frame #24: 0x000000010b2db2b0 Chromium`::-[MainApplicationDelegate application:didFinishLaunchingWithOptions:](self=0x00006000004fc9b0, _cmd="application:didFinishLaunchingWithOptions:", application=0x00007fadc4c03c40, launchOptions=0x0000000000000000) at main_application_delegate.mm:101
    frame #25: 0x0000000120d834d7 UIKitCore`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
    frame #26: 0x0000000120d84ec4 UIKitCore`-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3979
    frame #27: 0x0000000120d8a527 UIKitCore`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1623
    frame #28: 0x000000012162ce3e UIKitCore`__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
    frame #29: 0x0000000121629403 UIKitCore`+[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    frame #30: 0x000000012162ca7b UIKitCore`-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
    frame #31: 0x000000012162d435 UIKitCore`-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
    frame #32: 0x00000001215eab31 UIKitCore`__82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
    frame #33: 0x00000001215ea7db UIKitCore`-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
    frame #34: 0x000000012162f92c UIKitCore`__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
    frame #35: 0x0000000121630256 UIKitCore`_performActionsWithDelayForTransitionContext + 100
    frame #36: 0x000000012162f68b UIKitCore`-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
    frame #37: 0x0000000121628aa1 UIKitCore`-[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    frame #38: 0x0000000120d88d46 UIKitCore`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
    frame #39: 0x0000000120dba856 UIKitCore`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
    frame #40: 0x000000012938edda FrontBoardServices`-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
    frame #41: 0x0000000129399f43 FrontBoardServices`__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
    frame #42: 0x000000012939963a FrontBoardServices`__40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
    frame #43: 0x00000001237e163e libdispatch.dylib`_dispatch_client_callout + 8
    frame #44: 0x00000001237e4bb4 libdispatch.dylib`_dispatch_block_invoke_direct + 301
    frame #45: 0x00000001293ce3c8 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    frame #46: 0x00000001293ce080 FrontBoardServices`-[FBSSerialQueue _performNext] + 457
    frame #47: 0x00000001293ce660 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 45
    frame #48: 0x000000011a24fb31 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #49: 0x000000011a24f3a3 CoreFoundation`__CFRunLoopDoSources0 + 243
    frame #50: 0x000000011a249a4f CoreFoundation`__CFRunLoopRun + 1263
    frame #51: 0x000000011a249221 CoreFoundation`CFRunLoopRunSpecific + 625
    frame #52: 0x00000001263f41dd GraphicsServices`GSEventRunModal + 62
    frame #53: 0x0000000120d8c115 UIKitCore`UIApplicationMain + 140
    frame #54: 0x000000010b2d6c33 Chromium`(anonymous namespace)::RunUIApplicationMain(argc=1, argv=0x00007ffee492a298) at chrome_exe_main.mm:54
    frame #55: 0x000000010b2d6701 Chromium`main(argc=1, argv=0x00007ffee492a298) at chrome_exe_main.mm:78
    frame #56: 0x0000000123857551 libdyld.dylib`start + 1
    frame #57: 0x0000000123857551 libdyld.dylib`start + 1

My mistake, the change is that now native pages get success==NO.

I'm also seeing a lot of changes in the timing for how the NTP is displayed, now.

There's a gap between DidStartNav and didPageLoad, whereas before they were called immediately after one another in the same runloop.

Is that intentional?

I think I can work around it, but we'll need to make lots more changes in how the NTP is displayed.

You can see all these issues by loading the NTP, scrolling down on a content suggestion, and tapping back, forward, back, forward over and over
I think |success==NO| makes sense from ios/web perspective, because chrome://newtab is unsupported URL.

The gap between DidStartNav and didPageLoad is unavoidable, because WKWebView navigation is asynchronous.
Status: WontFix (was: Unconfirmed)
Marking as WontFix per offline conversation with eugenebut@

Sign in to add a comment