mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 15:30:09 +00:00
LibWeb: Allow splitting surrogate pairs in CharacterData.replaceData()
We're expected to handle this situation gracefully, and certainly not by falling apart like we were. Found by Domato.
This commit is contained in:
parent
416c478876
commit
33207174a9
Notes:
github-actions[bot]
2024-07-20 04:41:59 +00:00
Author: https://github.com/awesomekling 🔰
Commit: 33207174a9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/721
3 changed files with 23 additions and 2 deletions
|
@ -0,0 +1,16 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const str = '\uD2ED\uDEA6';
|
||||
let t = document.createTextNode(str);
|
||||
println("Before replaceData:");
|
||||
for (let i = 0; i < t.length; ++i) {
|
||||
println("[" + i + "]: " + t.data.charCodeAt(i));
|
||||
}
|
||||
t.replaceData(0, 1, '')
|
||||
println("After replaceData:");
|
||||
for (let i = 0; i < t.length; ++i) {
|
||||
println("[" + i + "]: " + t.data.charCodeAt(i));
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue