Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: eaa78a5094ac76bd4e28fdc820a45fad6004ef3c https://github.com/WebKit/WebKit/commit/eaa78a5094ac76bd4e28fdc820a45fad6004ef3c Author: Rupin Mittal <ru...@apple.com> Date: 2025-08-22 (Fri, 22 Aug 2025)
Changed paths: M LayoutTests/TestExpectations M Source/WebCore/page/Navigation.cpp Log Message: ----------- [Navigation API] imported/w3c/web-platform-tests/navigation-api/navigate-event/intercept-detach-multiple.html is crashing https://bugs.webkit.org/show_bug.cgi?id=297414 rdar://158349001 Reviewed by Ben Nham. The Navigation API spec in Step #7 here: (https://html.spec.whatwg.org/multipage/browsing-the-web.html#getting-session-history-entries-for-the-navigation-api) says that when getting the entries, we should start at index (startingIndex - 1) and work backwards while prepending the entries to our list. The code wasn't doing that. It was starting at 0 and working up to (startingIndex - 1). Given that we break if we see an entry with a different domain, that means that in the scenario where the entries before (startingIndex - 1) are: 1. foo.com 2. foo.com#A 3. bar.com 4. foo.com#B 5. current entry (of foo.com origin) And the origin we're filtering by is foo.com, the entries we'll end up with are: 1. foo.com 2. foo.com#A Whereas we should have ended up with: 1. foo.com#B m_entries corresponds to the entries that this navigation object can navigate the frame to. It cannot go from entry 5 to 2 because that would have gone to 3 first and cross-origin navigation aren't allowed by this API. So 2 should not be in the list at all. That's what is happening in this test. The entries in the list are incorrect and leading to an error down the line. * LayoutTests/TestExpectations: * Source/WebCore/page/Navigation.cpp: (WebCore::Navigation::initializeForNewWindow): Canonical link: https://commits.webkit.org/299078@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes