mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Added tests for missing xmlns during XHMTL parsing
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.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
9336b14d15
commit
6a5bca1302
Notes:
github-actions[bot]
2024-10-12 22:25:15 +00:00
Author: https://github.com/coryvirok Commit: https://github.com/LadybirdBrowser/ladybird/commit/6a5bca13021 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1755
20
Tests/LibWeb/Text/input/XHTML/parse-without-xmlns.html
Normal file
20
Tests/LibWeb/Text/input/XHTML/parse-without-xmlns.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user