Bug 1784303 - Fixed crashtest from Bug 1700237. r=smaug

This bug fixes issues introduced in Bug 1700237 where the crashtest caused an infinite loop of JS exceptions.

Differential Revision: https://phabricator.services.mozilla.com/D154491
This commit is contained in:
Jan-Niklas Jaeschke 2022-08-15 12:23:30 +00:00
Родитель 87bde7886c
Коммит 2ee3afc7f2
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -8,11 +8,17 @@
<script>
document.addEventListener("DOMContentLoaded", () => {
window.getSelection().modify("move", "backward", "line")
setInterval(() => {
const interval = setInterval(() => {
const m = new MutationObserver(() => {
let x = document.getSelection().getRangeAt(0)
a.appendChild(document.createElement("optgroup"))
x.comparePoint(document.activeElement, 1)
try {
x.comparePoint(document.activeElement, 1)
} catch (error) {
clearInterval(interval)
return
}
})
m.observe(b, {attributes: true})
b.setAttribute("x", "false")