Bug 1134545 - Insufficient null check. r=ehsan

This commit is contained in:
Aryeh Gregor 2015-03-25 13:52:56 -04:00
parent ab3bf34f45
commit 9d7ce1a1b6
3 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<!-- saved from url=(0065)https://bug1134545.bugzilla.mozilla.org/attachment.cgi?id=8566418 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script>
function boom()
{
textNode = document.createTextNode(" ");
x.appendChild(textNode);
x.setAttribute('contenteditable', "true");
textNode.remove();
window.getSelection().selectAllChildren(textNode);
document.execCommand("increasefontsize", false, null);
}
</script>
</head>
<body onload="boom();">
<div id="x" contenteditable="true"></div>
</body></html>

View File

@ -59,3 +59,4 @@ load 772282.html
load 776323.html
needs-focus load 793866.html
load 1057677.html
load 1134545.html

View File

@ -1527,10 +1527,10 @@ nsHTMLEditor::RelativeFontChange( int32_t aSizeChange)
int32_t offset;
nsCOMPtr<nsINode> selectedNode;
GetStartNodeAndOffset(selection, getter_AddRefs(selectedNode), &offset);
NS_ENSURE_TRUE(selectedNode, NS_OK);
if (IsTextNode(selectedNode)) {
if (selectedNode && IsTextNode(selectedNode)) {
selectedNode = selectedNode->GetParentNode();
}
NS_ENSURE_TRUE(selectedNode, NS_OK);
if (!CanContainTag(*selectedNode, *atom)) {
return NS_OK;
}