Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate item URL in BackForwardAddItem() IPC
https://bugs.webkit.org/show_bug.cgi?id=244620 <rdar://98999288> Reviewed by Brent Fulgham. When the client approves a navigation to a file URL, we keep track of it. We then use this information to validate the URL of the item in the BackForwardAddItem() IPC coming from the WebProcess. Also, update history.pushState() / replaceState() to throw if the new URL is a file URL and its path does not match the path of the current URL. This aligns WebKit's behavior with Blink and the specification: - https://html.spec.whatwg.org/multipage/history.html#can-have-its-url-rewritten (Step 4) This Web-exposed change is important since trying to call history.pushState() or replaceState() with a different file path would trip the IPC check I am adding in this patch. * LayoutTests/fast/loader/stateobjects/pushstate-frequency-iframe.html: * LayoutTests/fast/loader/stateobjects/pushstate-frequency.html: * LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt: * LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html: * LayoutTests/fast/loader/stateobjects/replacestate-frequency-iframe.html: * LayoutTests/fast/loader/stateobjects/replacestate-frequency.html: * LayoutTests/fast/loader/stateobjects/resources/pushstate-iframe.html: * LayoutTests/fast/loader/stateobjects/resources/replacestate-iframe.html: * LayoutTests/fast/loader/stateobjects/state-url-sets-links-visited.html: Update existing tests to reflect the Web-exposed changes to history.pushState() / replaceState(). * Source/WebCore/page/History.cpp: (WebCore::History::stateObjectAdded): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared): (WebKit::WebPageProxy::backForwardAddItem): * Source/WebKit/UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addPreviouslyApprovedFileURL): (WebKit::WebProcessProxy::wasPreviouslyApprovedFileURL const): * Source/WebKit/UIProcess/WebProcessProxy.h: Canonical link: https://commits.webkit.org/256785@main
- Loading branch information
Showing
34 changed files
with
169 additions
and
83 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
LayoutTests/fast/history/history-replace-updates-current-item-expected.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 25 additions & 21 deletions
46
...utTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
LayoutTests/http/tests/history/history-replace-updates-current-item-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
main frame - has 1 onunload handler(s) | ||
PASS | ||
|
||
============== Back Forward List ============== | ||
curr-> http://127.0.0.1:8000/history/resources/history-replace-updates-current-item-done.html **nav target** | ||
http://127.0.0.1:8000/history/resources/history-replace-updates-current-item-goback.html **nav target** | ||
=============================================== |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.