mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
committed by
Andreas Kling
parent
416c478876
commit
33207174a9
Notes:
github-actions[bot]
2024-07-20 04:41:59 +00:00
Author: https://github.com/awesomekling 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/33207174a9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/721
@@ -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>
|
||||
Reference in New Issue
Block a user