imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html is failing#37400
Conversation
|
EWS run on previous version of this PR (hash 9fff71a) Details |
rwlbuis
left a comment
There was a problem hiding this comment.
LGTM.
The sentence in the commit description needs fixing though:
"The test in question is
expecting since since it require navigation.entries to have 2 entries before
AND after the JS URL navigation."
|
FWIW some time ago I tried to make javascript URL not so special when doing a replace navigation by using SubstituteData. In theory that should fix entries-in-new-javascript-url-iframe.html and maybe entries-after-javascript-url-navigation.html. IIRC it caused some regressions and I dropped it, but I think it still may be nice to do it as it would simplify FrameLoader, so it is still on my list but not sure when I would have time. Anyway, this bug fix is valid and great, just wanted to give some background. |
9fff71a to
73cbedc
Compare
|
EWS run on current version of this PR (hash 73cbedc) Details |
…ry/entries-after-javascript-url-navigation.html is failing https://bugs.webkit.org/show_bug.cgi?id=284011 Reviewed by Rob Buis. When setting an iframe's src to a javascript URL and the js returns a String, we replace the document with that String, which counts as a "Replace" navigation (navigation which replaces the current HistoryItem). The test in question is expecting this since it expects `navigation.entries` to have 2 entries before AND after the JS URL navigation. The logic in FrameLoader::loadURL() was properly setting the NavigationAction's navigationType to `NavigationNavigationType::Replace`. However, before we would end up calling executeJavaScriptURL() instead of doing a proper navigation, we would not end up setting the NavigationAction object as the DocumentLoader's triggeringAction. The navigationType is supposed to get passed to Navigation::initializeForNewWindow() to make sure it replaces the current entry instead of creating a new one in this case. However, initializeForNewWindow() is called from FrameLoader::didBeginDocument() which gets it from the DocumentLoader's triggeringAction. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation-expected.txt: * Source/WebCore/bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeJavaScriptURL): * Source/WebCore/bindings/js/ScriptController.h: * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::executeJavaScriptURL): Canonical link: https://commits.webkit.org/287344@main
73cbedc to
cda0ce0
Compare
|
Committed 287344@main (cda0ce0): https://commits.webkit.org/287344@main Reviewed commits have been landed. Closing PR #37400 and removing active labels. |
cda0ce0
73cbedc
🧪 mac-AS-debug-wk2🛠 🧪 merge🛠 mac-safer-cpp