Bug 1283915 - Preserve input selection properties after type change. r=smaug
MozReview-Commit-ID: 7xJKc3vIpTY
This commit is contained in:
@@ -4826,12 +4826,22 @@ HTMLInputElement::HandleTypeChange(uint8_t aNewType)
|
||||
GetValue(aOldValue);
|
||||
}
|
||||
|
||||
nsTextEditorState::SelectionProperties sp;
|
||||
|
||||
if (GetEditorState()) {
|
||||
sp = mInputData.mState->GetSelectionProperties();
|
||||
}
|
||||
|
||||
// We already have a copy of the value, lets free it and changes the type.
|
||||
FreeData();
|
||||
mType = aNewType;
|
||||
|
||||
if (IsSingleLineTextControl()) {
|
||||
|
||||
mInputData.mState = new nsTextEditorState(this);
|
||||
if (!sp.IsDefault()) {
|
||||
mInputData.mState->SetSelectionProperties(sp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user