From 35162da718635b3c704ce93994c64ccb4c21ffca Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Fri, 3 Feb 2006 18:45:01 +0000 Subject: [PATCH] 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 --- mozilla/layout/forms/nsFileControlFrame.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 9e6fb2fe82c..ffd78499c77 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -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 textControl = + do_QueryInterface(mTextContent); + NS_ASSERTION(textControl, + " element not implementing nsIDOMHTMLInputElement?"); + + textControl->GetValue(aValue); } } return NS_OK;