Make sure to Reset() if our default value changes and we haven't had our value

change.  Bug 215228, r+sr=peterv, a=chofmann
This commit is contained in:
bzbarsky%mit.edu 2005-06-02 02:30:09 +00:00
Родитель 593378d76c
Коммит f2c921d06a
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -450,7 +450,11 @@ nsHTMLTextAreaElement::GetDefaultValue(nsAString& aDefaultValue)
NS_IMETHODIMP
nsHTMLTextAreaElement::SetDefaultValue(const nsAString& aDefaultValue)
{
return ReplaceContentsWithText(aDefaultValue, PR_TRUE);
nsresult rv = ReplaceContentsWithText(aDefaultValue, PR_TRUE);
if (NS_SUCCEEDED(rv) && !mValueChanged) {
Reset();
}
return rv;
}
nsresult
@ -624,7 +628,14 @@ nsHTMLTextAreaElement::GetInnerHTML(nsAString& aInnerHTML)
nsresult
nsHTMLTextAreaElement::SetInnerHTML(const nsAString& aInnerHTML)
{
return ReplaceContentsWithText(aInnerHTML, PR_TRUE);
// XXXbz we can't use the normal SetInnerHTML because the parser
// thinks we're a leaf, what with the whole CollectSkippedContent
// mess.
nsresult rv = ReplaceContentsWithText(aInnerHTML, PR_TRUE);
if (NS_SUCCEEDED(rv) && !mValueChanged) {
Reset();
}
return rv;
}
// Controllers Methods