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
This commit is contained in:
Ray Lin
2017-07-20 15:40:46 +08:00
parent c7ea83669e
commit 9ded2ca5ca
2 changed files with 13 additions and 0 deletions

View File

@@ -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;
}