Bug 1680951 - Do not scroll when calling select() r=masayuki

This is intended to be a hotfix for the URL bar regression. Ideally there should be a spec or this behavior should be removed completely.

Previously select() scrolled back to the start position before the regression, but this fix does not restore that behavior.

Differential Revision: https://phabricator.services.mozilla.com/D98972
This commit is contained in:
Kagami Sascha Rosylight
2020-12-09 20:59:17 +00:00
parent 09d056d607
commit da8621865a
5 changed files with 58 additions and 16 deletions

View File

@@ -3055,11 +3055,8 @@ void HTMLInputElement::Select() {
// Directly call TextControlState::SetSelectionRange because
// HTMLInputElement::SetSelectionRange only applies to fewer types
// TODO(krosylight): This should pass eNone per the spec, but we don't support
// it yet. See bug 1541454.
state->SetSelectionRange(0, UINT32_MAX,
nsITextControlFrame::SelectionDirection::eForward,
IgnoredErrorResult());
state->SetSelectionRange(0, UINT32_MAX, Optional<nsAString>(), IgnoreErrors(),
TextControlState::ScrollAfterSelection::No);
}
void HTMLInputElement::DispatchSelectEvent(nsPresContext* aPresContext) {