mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-05 06:47:11 +00:00
Merge pull request #1460 from lightpanda-io/dupe-url-nav
fix slice alias crash after same document navigation
This commit is contained in:
@@ -271,9 +271,16 @@ pub fn navigateInner(
|
|||||||
const committed = local.createPromiseResolver();
|
const committed = local.createPromiseResolver();
|
||||||
const finished = local.createPromiseResolver();
|
const finished = local.createPromiseResolver();
|
||||||
|
|
||||||
const new_url = try URL.resolve(arena, page.url, url, .{});
|
var new_url = try URL.resolve(arena, page.url, url, .{});
|
||||||
const is_same_document = URL.eqlDocument(new_url, page.url);
|
const is_same_document = URL.eqlDocument(new_url, page.url);
|
||||||
|
|
||||||
|
// In case of navigation to the same document, we force an url duplication.
|
||||||
|
// Keeping the same url generates a crash during WPT test navigate-history-push-same-url.html.
|
||||||
|
// When building a script's src, script's base and page url overlap.
|
||||||
|
if (is_same_document) {
|
||||||
|
new_url = try arena.dupeZ(u8, new_url);
|
||||||
|
}
|
||||||
|
|
||||||
const previous = self.getCurrentEntry();
|
const previous = self.getCurrentEntry();
|
||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
|
|||||||
Reference in New Issue
Block a user