mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
LibWeb: Use the correct document URL in DOMParser.parseFromString()
We were hard-coding "about:blank" as the document URL for parsed HTML documents, which was definitely not correct. This fixes a bunch of WPT tests under /domparsing/ :^)
This commit is contained in:
parent
323370dfa3
commit
55f58eea99
Notes:
github-actions[bot]
2024-10-17 17:17:10 +00:00
Author: https://github.com/awesomekling
Commit: 55f58eea99
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1841
Reviewed-by: https://github.com/fdellwing
3 changed files with 22 additions and 2 deletions
|
@ -0,0 +1,19 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const parser = new DOMParser();
|
||||
|
||||
for (const mimeType of ["text/html", "application/xhtml+xml"]) {
|
||||
const doc = parser.parseFromString("<html><b>hello", mimeType);
|
||||
if (doc.URL == "about:blank") {
|
||||
println("FAIL 1 " + mimeType);
|
||||
} else if (!doc.URL.endsWith(".html")) {
|
||||
println("FAIL 2 " + mimeType);
|
||||
} else if (doc.URL == document.URL) {
|
||||
println("PASS " + mimeType);
|
||||
} else {
|
||||
println("FAIL 3 " + mimeType);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue