Skip to content

Commit

Permalink
Bug 570624 - "ASSERTION: called nsGenericElement::SetText"; r=roc
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 24d41a8eccef1c6d8b3adc6a04ca1a20912263ef
  • Loading branch information
ehsan committed Jun 9, 2010
1 parent f1bf233 commit 8c01804
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions layout/forms/crashtests/570624-1.html
@@ -0,0 +1,15 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function boom()
{
var xt = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", 'textbox');
document.body.appendChild(xt);
xt.setAttribute('disabled', "true");
xt.setAttribute('value', "foo");
}
</script>
</head>
<body onload="boom();">
</body>
</html>
1 change: 1 addition & 0 deletions layout/forms/crashtests/crashtests.list
Expand Up @@ -38,4 +38,5 @@ load 455451-1.html
load 457537-1.html
load 457537-2.html
load 478219-1.xhtml
load 570624-1.html
load 498698-1.html
9 changes: 4 additions & 5 deletions layout/forms/nsTextControlFrame.cpp
Expand Up @@ -822,9 +822,8 @@ nsTextControlFrame::GetRootNodeAndInitializeEditor(nsIDOMElement **aRootElement)
{
NS_ENSURE_ARG_POINTER(aRootElement);

nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
NS_ASSERTION(txtCtrl, "Content not a text control element");
nsIEditor* editor = txtCtrl->GetTextEditor();
nsCOMPtr<nsIEditor> editor;
GetEditor(getter_AddRefs(editor));
if (!editor)
return NS_OK;

Expand Down Expand Up @@ -1216,9 +1215,9 @@ nsTextControlFrame::AttributeChanged(PRInt32 aNameSpaceID,
const PRBool needEditor = nsGkAtoms::maxlength == aAttribute ||
nsGkAtoms::readonly == aAttribute ||
nsGkAtoms::disabled == aAttribute;
nsIEditor *editor = nsnull;
nsCOMPtr<nsIEditor> editor;
if (needEditor) {
editor = txtCtrl->GetTextEditor();
GetEditor(getter_AddRefs(editor));
}
if ((needEditor && !editor) || !selCon)
return nsBoxFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);;
Expand Down

0 comments on commit 8c01804

Please sign in to comment.