Bug 1707630 - Fix the crash with a one line fix r=m_kato

For making it's upliftable, this patch just fixes the crash with a one line fix.

Depends on D113282

Differential Revision: https://phabricator.services.mozilla.com/D113471
This commit is contained in:
Masayuki Nakano 2021-04-28 03:33:25 +00:00
parent ce84c86379
commit a6ae919f0e
3 changed files with 18 additions and 1 deletions

View File

@ -6770,7 +6770,7 @@ EditActionResult HTMLEditor::HandleInsertParagraphInParagraph(
NS_WARNING_ASSERTION(
brContent,
"HTMLEditor::InsertBRElementWithTransaction() failed, but ignored");
if (splitAfterNewBR) {
if (splitAfterNewBR && brContent) {
// We split the parent after the br we've just inserted.
pointToSplitParentDivOrP.SetAfter(brContent);
NS_WARNING_ASSERTION(pointToSplitParentDivOrP.IsSet(),

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<script>
window.addEventListener('load', () => {
document = document
document.documentElement = document.documentElement
document.addEventListener('DOMNodeInserted', (e) => {
e.currentTarget.removeChild(e.currentTarget.childNodes[(2731378636 % e.currentTarget.childNodes.length)])
}, {})
document.documentElement.contentEditable = true
document.execCommand('insertParagraph', false, null)
})
</script>
</head>
</html>

View File

@ -146,3 +146,4 @@ asserts(1) load 1677566.html # assertion in constructor of TextFragmentData (ini
load 1691051.html
load 1699866.html
load 1701348.html
load 1707630.html