Bug 253870 - Make disabled form controls selectable. r=masayuki,MarcoZ
This rejiggers a bit the way selection focus is handled so that focusing a disabled form control with the mouse handles selection properly, and hides the document selection and so on. This matches the behavior of other browsers as far as I can tell. Given now readonly and disabled editors behave the same, we can simplify a bit the surrounding editor code. Differential Revision: https://phabricator.services.mozilla.com/D66464
This commit is contained in:
@@ -6639,18 +6639,13 @@ void HTMLInputElement::OnValueChanged(ValueChangeKind aKind) {
|
||||
}
|
||||
|
||||
bool HTMLInputElement::HasCachedSelection() {
|
||||
bool isCached = false;
|
||||
TextControlState* state = GetEditorState();
|
||||
if (state) {
|
||||
isCached = state->IsSelectionCached() &&
|
||||
state->HasNeverInitializedBefore() &&
|
||||
state->GetSelectionProperties().GetStart() !=
|
||||
state->GetSelectionProperties().GetEnd();
|
||||
if (isCached) {
|
||||
state->WillInitEagerly();
|
||||
}
|
||||
if (!state) {
|
||||
return false;
|
||||
}
|
||||
return isCached;
|
||||
return state->IsSelectionCached() && state->HasNeverInitializedBefore() &&
|
||||
state->GetSelectionProperties().GetStart() !=
|
||||
state->GetSelectionProperties().GetEnd();
|
||||
}
|
||||
|
||||
void HTMLInputElement::FieldSetDisabledChanged(bool aNotify) {
|
||||
|
||||
Reference in New Issue
Block a user