Bug 1635224 - Preserve mLastValueChangeWasInteractive between SaveState and RestoreState r=emilio,masayuki
Modify PresState's string variant to also store whether the last change was interactive, and preserve that property when saving and restoring state. Differential Revision: https://phabricator.services.mozilla.com/D73920
This commit is contained in:
@@ -735,7 +735,8 @@ HTMLTextAreaElement::SaveState() {
|
||||
return rv;
|
||||
}
|
||||
|
||||
state->contentData() = std::move(value);
|
||||
state->contentData() =
|
||||
TextContentData(value, mLastValueChangeWasInteractive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,12 +758,15 @@ HTMLTextAreaElement::SaveState() {
|
||||
bool HTMLTextAreaElement::RestoreState(PresState* aState) {
|
||||
const PresContentData& state = aState->contentData();
|
||||
|
||||
if (state.type() == PresContentData::TnsString) {
|
||||
if (state.type() == PresContentData::TTextContentData) {
|
||||
ErrorResult rv;
|
||||
SetValue(state.get_nsString(), rv);
|
||||
SetValue(state.get_TextContentData().value(), rv);
|
||||
ENSURE_SUCCESS(rv, false);
|
||||
if (state.get_TextContentData().lastValueChangeWasInteractive()) {
|
||||
mLastValueChangeWasInteractive = true;
|
||||
UpdateState(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (aState->disabledSet() && !aState->disabled()) {
|
||||
SetDisabled(false, IgnoreErrors());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user