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;