mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-03 07:32:00 +00:00
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/ :^)
19 lines
650 B
HTML
19 lines
650 B
HTML
<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>
|