Bug 74639: Preserve frame state through form demotion, don't store uninitialized frame state, r=nisheeth@netscape.com, sr=jst@netscape.com
This commit is contained in:
@@ -655,12 +655,15 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
|
||||
|
||||
NS_IMETHODIMP nsFileControlFrame::GetProperty(nsIAtom* aName, nsAWritableString& aValue)
|
||||
{
|
||||
// Return the value of the property from the widget it is not null.
|
||||
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
|
||||
aValue.Truncate(); // initialize out param
|
||||
|
||||
if (nsHTMLAtoms::value == aName) {
|
||||
if (mTextFrame)
|
||||
if (mTextFrame) {
|
||||
mTextFrame->GetTextControlFrameState(aValue);
|
||||
}
|
||||
else if (mCachedState) {
|
||||
aValue.Assign(*mCachedState);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -699,6 +702,11 @@ nsFileControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** aStat
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aState);
|
||||
|
||||
// Don't save state before we are initialized
|
||||
if (!mTextFrame && !mCachedState) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Get the value string
|
||||
nsAutoString stateString;
|
||||
nsresult res = GetProperty(nsHTMLAtoms::value, stateString);
|
||||
|
||||
Reference in New Issue
Block a user