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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user