WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
282689
[Navigation] Fix remaining problems with traversals
https://bugs.webkit.org/show_bug.cgi?id=282689
Summary
[Navigation] Fix remaining problems with traversals
Rob Buis
Reported
2024-11-06 06:45:56 PST
Fix remaining problems with traversals.
Attachments
Add attachment
proposed patch, testcase, etc.
Rob Buis
Comment 1
2024-11-06 06:46:57 PST
Traversal tests timing out: navigation-methods/back-forward-multiple-frames.html traverseTo-detach-between-navigate-and-navigatesucces.html navigation-traverseTo-in-iframe-same-document-preventDefault.html navigation-traverseTo-navigates-top-and-same-doc-child-and-cross-doc-child.html
Rob Buis
Comment 2
2024-11-06 06:48:34 PST
This will have to be debugged more closely to see what is the problem. I suspect that for at least for one of them the problem is not correctly cancelling navigation for both top and subframe.
Radar WebKit Bug Importer
Comment 3
2024-11-13 06:46:13 PST
<
rdar://problem/139799959
>
Chris Dumez
Comment 4
2024-12-09 07:49:41 PST
I started taking a look at navigation-methods/back-forward-multiple-frames.html. At the following step: // Going back in top should go 3->1 (navigating both windows). This resolves: ``` await navigation.back().commited; ``` but this doesn't: ``` new Promise(resolve => i.contentWindow.onpopstate = resolve) ```
Chris Dumez
Comment 5
2024-12-09 08:18:21 PST
navigation-methods/back-forward-multiple-frames.html has a top frame and an iframe. The test does this: 1. Navigate the top frame to "#top" 2. Navigate the iframe to "#iframe" 3. Call `navigation.back()` in the top frame 4. Expects both the top frame and the iframe to get navigated back (so that the fragment is removed from both) and a popstate event to get fired in both frames. This works in Blink but in WebKit, only the top frame gets navigated and gets a popstate event. The iframe is still sitting on "#iframe" after calling `navigation.back()` in the top frame.
Chris Dumez
Comment 6
2024-12-09 09:10:14 PST
(In reply to Chris Dumez from
comment #5
)
> navigation-methods/back-forward-multiple-frames.html has a top frame and an > iframe. > The test does this: > 1. Navigate the top frame to "#top" > 2. Navigate the iframe to "#iframe" > 3. Call `navigation.back()` in the top frame > 4. Expects both the top frame and the iframe to get navigated back (so that > the fragment is removed from both) and a popstate event to get fired in both > frames. > > This works in Blink but in WebKit, only the top frame gets navigated and > gets a popstate event. The iframe is still sitting on "#iframe" after > calling `navigation.back()` in the top frame.
Looking at the `Navigation::back()` implementation, it does look like it doesn't quite match the specification and only navigates a single frame. In the spec, we're supposed to also navigate child frames if the navigation of the parent frame doesn't change document (i.e. just a fragment navigation).
Chris Dumez
Comment 7
2024-12-09 09:19:38 PST
(In reply to Chris Dumez from
comment #6
)
> (In reply to Chris Dumez from
comment #5
) > > navigation-methods/back-forward-multiple-frames.html has a top frame and an > > iframe. > > The test does this: > > 1. Navigate the top frame to "#top" > > 2. Navigate the iframe to "#iframe" > > 3. Call `navigation.back()` in the top frame > > 4. Expects both the top frame and the iframe to get navigated back (so that > > the fragment is removed from both) and a popstate event to get fired in both > > frames. > > > > This works in Blink but in WebKit, only the top frame gets navigated and > > gets a popstate event. The iframe is still sitting on "#iframe" after > > calling `navigation.back()` in the top frame. > > Looking at the `Navigation::back()` implementation, it does look like it > doesn't quite match the specification and only navigates a single frame. In > the spec, we're supposed to also navigate child frames if the navigation of > the parent frame doesn't change document (i.e. just a fragment navigation).
Relevant spec:
https://html.spec.whatwg.org/#getting-all-navigables-that-might-experience-a-cross-document-traversal
Chris Dumez
Comment 8
2024-12-09 09:24:26 PST
(In reply to Chris Dumez from
comment #7
)
> (In reply to Chris Dumez from
comment #6
) > > (In reply to Chris Dumez from
comment #5
) > > > navigation-methods/back-forward-multiple-frames.html has a top frame and an > > > iframe. > > > The test does this: > > > 1. Navigate the top frame to "#top" > > > 2. Navigate the iframe to "#iframe" > > > 3. Call `navigation.back()` in the top frame > > > 4. Expects both the top frame and the iframe to get navigated back (so that > > > the fragment is removed from both) and a popstate event to get fired in both > > > frames. > > > > > > This works in Blink but in WebKit, only the top frame gets navigated and > > > gets a popstate event. The iframe is still sitting on "#iframe" after > > > calling `navigation.back()` in the top frame. > > > > Looking at the `Navigation::back()` implementation, it does look like it > > doesn't quite match the specification and only navigates a single frame. In > > the spec, we're supposed to also navigate child frames if the navigation of > > the parent frame doesn't change document (i.e. just a fragment navigation). > > Relevant spec: >
https://html.spec.whatwg.org/#getting-all-navigables-that-might-experience-a
- > cross-document-traversal
And
https://html.spec.whatwg.org/#get-all-navigables-whose-current-session-history-entry-will-change-or-reload
Chris Dumez
Comment 9
2024-12-19 15:58:15 PST
Still failing: - imported/w3c/web-platform-tests/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html - imported/w3c/web-platform-tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html Other failures have been addressed in the dependency
Bug 284865
.
Chris Dumez
Comment 10
2024-12-20 15:13:49 PST
Bug 285045
should take care of: - imported/w3c/web-platform-tests/navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html
Chris Dumez
Comment 11
2024-12-20 15:51:49 PST
Did some early investigation for imported/w3c/web-platform-tests/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html, it seems due to the following code in `FrameLoader::stopLoading()`: ``` if (document->settings().navigationAPIEnabled() && !m_doNotAbortNavigationAPI && unloadEventPolicy != UnloadEventPolicy::UnloadAndPageHide) { RefPtr window = m_frame->document()->domWindow(); window->protectedNavigation()->abortOngoingNavigationIfNeeded(); } ``` If you comment out the `unloadEventPolicy != UnloadEventPolicy::UnloadAndPageHide` check then the test start passing.
Chris Dumez
Comment 12
2024-12-20 16:13:04 PST
(In reply to Chris Dumez from
comment #11
)
> Did some early investigation for > imported/w3c/web-platform-tests/navigation-api/navigation-methods/traverseTo- > detach-between-navigate-and-navigatesuccess.html, it seems due to the > following code in `FrameLoader::stopLoading()`: > ``` > if (document->settings().navigationAPIEnabled() && > !m_doNotAbortNavigationAPI && unloadEventPolicy != > UnloadEventPolicy::UnloadAndPageHide) { > RefPtr window = m_frame->document()->domWindow(); > window->protectedNavigation()->abortOngoingNavigationIfNeeded(); > } > ``` > > If you comment out the `unloadEventPolicy != > UnloadEventPolicy::UnloadAndPageHide` check then the test start passing.
Making this change breaks a few tests though: imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-history-push-same-url-cross-document.html [ Failure ] imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/traverseTo-detach-same-document-before-navigate-event.html [ Failure ] imported/w3c/web-platform-tests/navigation-api/ordering-and-transition/transition-cross-document.html [ Failure ]
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug