gecko-dev/editor/libeditor/crashtests/1533913.html
Masayuki Nakano 761f01d612 Bug 1533913 - Make HTMLEditRules::ApplyBlockStyle() stop handling it if target node is moved from expected container unexpectedly r=m_kato
`HTMLEditRules::ApplyBlockStyle()` stores `curBlock` and `newBlock` during its
loop to keep handling from deeper child to ancestor, and may do two things for
a `curNode`.  If `curBlock` and/or `newBlock` is moved from expected container
when it sets one of or both of them, this patch check whether mutation event
listeners change the DOM tree.  Additionally, this patch also checks whether
`curNode' is moved by mutation event listener at first step of two jobs for it.

Differential Revision: https://phabricator.services.mozilla.com/D32689

--HG--
extra : moz-landing-system : lando
2019-05-29 04:44:23 +00:00

15 lines
356 B
HTML

<script>
function go() {
document.execCommand("justifyFull", false)
document.execCommand("selectAll", false)
window.top.addEventListener("DOMNodeRemoved", eh)
document.execCommand("heading", false, "H1")
}
function eh() {
document.execCommand("insertHTML", false, undefined)
}
</script>
<body onload=go()>
<dd contenteditable="true">A
<!-- A -->