Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 204956f9a3a32504628ecf777ac3482c9a221560
https://github.com/WebKit/WebKit/commit/204956f9a3a32504628ecf777ac3482c9a221560
Author: Rupin Mittal <[email protected]>
Date: 2025-09-29 (Mon, 29 Sep 2025)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/navigation-api/per-entry-events/dispose-for-navigation-in-child-expected.txt
M Source/WebCore/page/LocalDOMWindowProperty.cpp
M Source/WebCore/page/LocalDOMWindowProperty.h
M Source/WebCore/page/Navigation.cpp
M Source/WebCore/page/Navigation.h
Log Message:
-----------
[Navigation API]
navigation-api/per-entry-events/dispose-for-navigation-in-child.html is failing
https://bugs.webkit.org/show_bug.cgi?id=299628
rdar://161203486
Reviewed by Basuke Suzuki.
Suppose we have a mainframe and an iframe and this series of navigations
happens:
1. iframe fragment navigates to "/#a"
2. main frame fragment navigates to "/#1"
3. main frame fragment navigates to "/#2"
4. main frame fragment navigates to "/#3"
5. iframe goes back
6. iframe fragment navigates to "/#b"
After Step 5, the UI Process b/f list should be:
A) mainframe - URL - ItemID A
** iframe - URL - ItemID A
B) mainframe - URL - ItemID B
** iframe - URL/#a - ItemID B
C) mainframe - URL/#1 - ItemID C
** iframe - URL/#a - ItemID C
D) mainframe - URL/#2 - ItemID D
** iframe - URL/#a - ItemID D
E) mainframe - URL/#3 - ItemID E
** iframe - URL/#a - ItemID E
The mainframe's Navigation object's m_entries should be:
A) mainframe - URL - ItemID A
C) mainframe - URL/#1 - ItemID C
D) mainframe - URL/#2 - ItemID D
E) mainframe - URL/#3 - ItemID E <--- current index
The iframe's Navigation object's m_entries should be:
A) ** iframe - URL - ItemID A <--- current index
E) ** iframe - URL/#a - ItemID E
According to this layout test, after Step 6:
The mainframe's Navigation object's m_entries should be:
A) mainframe - URL - ItemID A <--- current index
The iframe's Navigation object's m_entries should be:
A) ** iframe - URL - ItemID A
F) ** iframe - URL/#b - ItemID F <--- current index
So when a subframe has a PUSH same-document navigation and disposes of any
forward entries, any parent frame must do the same.
This test was failing because the parent frame was not disposing of its
forward entries. To fix this, we add a new function to recusively dispose
of all forward entries in any parent frames when a subframe has a PUSH
same-document navigation. We use the ItemID to determine what entry must
stay and then dispose of any entries that come after that one.
*
LayoutTests/imported/w3c/web-platform-tests/navigation-api/per-entry-events/dispose-for-navigation-in-child-expected.txt:
* Source/WebCore/page/LocalDOMWindowProperty.cpp:
(WebCore::LocalDOMWindowProperty::protectedFrame const):
* Source/WebCore/page/LocalDOMWindowProperty.h:
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::updateNavigationEntry):
(WebCore::Navigation::disposeOfForwardEntriesInParents):
Call recursivelyDisposeOfForwardEntriesInParents on the main frame,
which will traverse down the frame tree, and for each frame until we reach the
subframe that actually navigated, dispose of any forward entries.
(WebCore::Navigation::recursivelyDisposeOfForwardEntriesInParents):
(WebCore::Navigation::updateForNavigation):
This is called for same-document navigations. If it's a PUSH navigation, call
disposeOfForwardEntriesInParents. The ItemID that we keep in these parent frames
is the current ItemID right before this PUSH operation happens.
* Source/WebCore/page/Navigation.h:
Canonical link: https://commits.webkit.org/300721@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes