Add null checks in nsAutoSelectionReset to fix bug 407256. Patch by Chris Pearce, r+sr=peterv, a=blocking1.9+.
This commit is contained in:
Родитель
3aa7f778a6
Коммит
5db9034c14
|
@ -0,0 +1,23 @@
|
|||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
function boom()
|
||||
{
|
||||
document.addEventListener("DOMNodeInserted", x, false);
|
||||
|
||||
function x()
|
||||
{
|
||||
document.removeEventListener("DOMNodeInserted", x, false);
|
||||
document.execCommand("insertParagraph", false, "");
|
||||
}
|
||||
|
||||
document.execCommand("insertorderedlist", false, "");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body contenteditable="true" onload="boom()"></body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
load 407256-1.html
|
|
@ -71,6 +71,7 @@ mSel(nsnull)
|
|||
|
||||
nsAutoSelectionReset::~nsAutoSelectionReset()
|
||||
{
|
||||
NS_ASSERTION(!mSel || mEd, "mEd should be non-null when mSel is");
|
||||
if (mSel && mEd->ArePreservingSelection()) // mSel will be null if this was nested call
|
||||
{
|
||||
mEd->RestorePreservedSelection(mSel);
|
||||
|
@ -80,7 +81,9 @@ nsAutoSelectionReset::~nsAutoSelectionReset()
|
|||
void
|
||||
nsAutoSelectionReset::Abort()
|
||||
{
|
||||
mEd->StopPreservingSelection();
|
||||
NS_ASSERTION(!mSel || mEd, "mEd should be non-null when mSel is");
|
||||
if (mSel)
|
||||
mEd->StopPreservingSelection();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ include ../../dom/src/offline/crashtests/crashtests.list
|
|||
include ../../dom/src/jsurl/crashtests/crashtests.list
|
||||
|
||||
include ../../editor/libeditor/html/crashtests/crashtests.list
|
||||
include ../../editor/libeditor/base/crashtests/crashtests.list
|
||||
|
||||
include ../../js/src/xpconnect/crashtests/crashtests.list
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче