mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb: Calculate length for all CharacterData
type nodes correctly
We now ensure that `Node::is_character_data()` returns true for all nodes of type character data. Previously, calling `Node::length()` on `CDataSection` or `ProcessingInstruction` nodes would return an incorrect value.
This commit is contained in:
parent
f8b1e96e2b
commit
3802d9ccc4
Notes:
github-actions[bot]
2024-07-25 14:58:20 +00:00
Author: https://github.com/tcl3
Commit: 3802d9ccc4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/798
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/trflynn89
3 changed files with 14 additions and 1 deletions
|
@ -0,0 +1,11 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const xmlDocument = new DOMParser().parseFromString(`<xml></xml>`, "application/xml");
|
||||
const cdata = xmlDocument.createCDATASection("DATA");
|
||||
const range = xmlDocument.createRange();
|
||||
range.setStart(cdata, 0);
|
||||
range.setEnd(cdata, 3);
|
||||
println(`range start offset: ${range.startOffset}, end offset: ${range.endOffset}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue