Make sure to always produce our value. Bug 324377, r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@188866 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2006-02-03 18:45:01 +00:00
parent 4fe61af9b5
commit 35162da718

View File

@@ -582,11 +582,17 @@ nsFileControlFrame::GetFormProperty(nsIAtom* aName, nsAString& aValue) const
aValue.Truncate(); // initialize out param
if (nsHTMLAtoms::value == aName) {
if (mTextFrame) {
mTextFrame->GetValue(aValue, PR_FALSE);
}
else if (mCachedState) {
NS_ASSERTION(!mCachedState || !mTextFrame,
"If we have a cached state, we better have no mTextFrame");
if (mCachedState) {
aValue.Assign(*mCachedState);
} else if (mTextContent) {
nsCOMPtr<nsIDOMHTMLInputElement> textControl =
do_QueryInterface(mTextContent);
NS_ASSERTION(textControl,
"<input> element not implementing nsIDOMHTMLInputElement?");
textControl->GetValue(aValue);
}
}
return NS_OK;