1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #2548 - Part 5 - Implement the HTMLOrForeignElement mixin. https://bugzilla.mozilla.org/show_bug.cgi?id=1577660 Add 'preventScroll' option to HTMLElement's, SVGElement's and XULElement's 'focus' method. https://bugzilla.mozilla.org/show_bug.cgi?id=1374045

This commit is contained in:
Brian Smith
2026-03-20 03:19:58 -05:00
committed by roytam1
parent 502c704770
commit 3febe21f99
20 changed files with 78 additions and 43 deletions
+10 -2
View File
@@ -308,7 +308,11 @@ public:
NS_IMETHOD Run() override
{
if (mNumber->AsElement()->State().HasState(NS_EVENT_STATE_FOCUS)) {
HTMLInputElement::FromContent(mTextField)->Focus();
// This job shouldn't be triggered by a WebIDL interface, hence the
// default options can be used.
FocusOptions options;
ErrorResult rv;
HTMLInputElement::FromContent(mTextField)->Focus(options, rv);
}
return NS_OK;
@@ -595,7 +599,11 @@ nsNumberControlFrame::HandleFocusEvent(WidgetEvent* aEvent)
if (aEvent->mOriginalTarget != mTextField) {
// Move focus to our text field
RefPtr<HTMLInputElement> textField = HTMLInputElement::FromContent(mTextField);
textField->Focus();
// Use default FocusOptions, because this method isn't supposed to be called
// from a WebIDL interface.
FocusOptions options;
ErrorResult rv;
textField->Focus(options, rv);
}
}