mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-13 18:37:37 +02:00
The main culprit for the following WPT test failure is that we weren't using the HTML namespace for XHTML docs unless one was explicitly provided. (cherry picked from commit 6a5bca1302161a84d95313bef1481d9a8a56702c)
21 lines
692 B
HTML
21 lines
692 B
HTML
<!DOCTYPE html>
|
|
<meta charset=utf-8>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
const parser = new DOMParser();
|
|
const parse = parser.parseFromString.bind(parser);
|
|
|
|
// Adapted from https://wpt.live/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-1.htm
|
|
test(() => {
|
|
const source = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "foo"><html><head></head><body id='test'>hello</body></html>`
|
|
const doc = parse(source, 'application/xhtml+xml')
|
|
const root = doc.getElementById('test')
|
|
try {
|
|
const text = root.firstChild.data
|
|
println("PASS")
|
|
} catch (err) {
|
|
println("FAIL - " + err)
|
|
}
|
|
})
|
|
</script>
|