LibWeb: Allow changing the query of file:// URL via history.pushState()

The spec didn't match how other browsers behave, and we dutifully did
what the spec said. A spec bug has been filed, so let's fix this locally
for now with a FIXME.
This commit is contained in:
Andreas Kling 2024-08-06 13:31:21 +02:00 committed by Andreas Kling
commit e3408c4a7f
Notes: github-actions[bot] 2024-08-06 14:34:16 +00:00
3 changed files with 32 additions and 2 deletions

View file

@ -0,0 +1,24 @@
<script src="../include.js"></script>
<script>
asyncTest((done) => {
try {
history.pushState({}, null, "?tweaked");
println("Good: changing the query via pushState()");
} catch (e) {
println("FAIL: Threw!");
}
try {
history.pushState({}, null, "other.html");
println("FAIL: Should have thrown!");
} catch (e) {
println("Good: threw on changing the filename via pushState()");
}
try {
history.pushState({}, null, "History-pushState-change-query.html");
println("Good: going back to the original filename");
} catch (e) {
println("FAIL: threw on going back to original filename");
}
done();
});
</script>