fix: Allow links with duplicate href if rel is different (#5071)

Fixes #5070
This commit is contained in:
Paul Hansen authored and GitHub committed 2025-12-09 13:53:42 +00:00
1 parent c01770fcfb
commit 8a38e7ca76
3 files changed
+52 -4

No files matched your search

+26
View File
@@ -154,6 +154,32 @@ fn DocumentElements() -> Element {
document::Stylesheet { id: "stylesheet-head", href: "https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic" }
document::Script { id: "script-head", async: true, "console.log('hello world');" }
document::Style { id: "style-head", "body {{ font-family: 'Roboto'; }}" }
// Test that links with same href but different rel are NOT deduplicated
// See https://github.com/DioxusLabs/dioxus/issues/5070
document::Link {
id: "dedup-preload",
rel: "preload",
href: "dedup-test.css",
r#as: "style",
}
document::Link {
id: "dedup-stylesheet",
rel: "stylesheet",
href: "dedup-test.css",
}
// Test that links with same href AND same rel ARE deduplicated
document::Link {
id: "dedup-first",
rel: "stylesheet",
href: "dedup-same.css",
}
document::Link {
id: "dedup-second",
rel: "stylesheet",
href: "dedup-same.css",
}
}
}