mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1382189 - Persist preview value in PressState for select element to ensure the text is consistent after frame re-construction. r=heycam
MozReview-Commit-ID: piZkkGlWrs --HG-- extra : rebase_source : 9a58a2591770c4ec9e8183bdd6fe2add2ee028f9
This commit is contained in:
parent
d229288071
commit
c564ceceb5
@ -111,6 +111,16 @@ public:
|
||||
return mDroppedDown;
|
||||
}
|
||||
|
||||
void SetPreviewText(const nsAString& aValue)
|
||||
{
|
||||
mPreviewText = aValue;
|
||||
}
|
||||
|
||||
void GetPreviewText(nsAString& aValue)
|
||||
{
|
||||
aValue = mPreviewText;
|
||||
}
|
||||
|
||||
// MEMBER VARIABLES
|
||||
protected:
|
||||
nsCOMPtr<nsISupports> mContentData;
|
||||
@ -121,6 +131,7 @@ protected:
|
||||
bool mDisabledSet;
|
||||
bool mDisabled;
|
||||
bool mDroppedDown;
|
||||
nsString mPreviewText;
|
||||
};
|
||||
|
||||
#endif /* nsPresState_h_ */
|
||||
|
@ -1681,6 +1681,7 @@ nsComboboxControlFrame::SaveState(nsPresState** aState)
|
||||
MOZ_ASSERT(!(*aState));
|
||||
(*aState) = new nsPresState();
|
||||
(*aState)->SetDroppedDown(mDroppedDown);
|
||||
(*aState)->SetPreviewText(mPreviewText);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1690,6 +1691,7 @@ nsComboboxControlFrame::RestoreState(nsPresState* aState)
|
||||
if (!aState) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
aState->GetPreviewText(mPreviewText);
|
||||
ShowList(aState->GetDroppedDown()); // might destroy us
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user