Closed Bug 1454785 Opened 4 years ago Closed 4 years ago

Input fields that are focused via a11y takeFocus don't bring up the Android keyboard

Categories

(Core :: Disability Access APIs, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

This is because the resulting focus event is seen as a scripted event and not initiated by the user.
Attachment #8968721 - Flags: review?(surkov.alexander)
Comment on attachment 8968721 [details] [diff] [review]
Make TakeFocus user initiated. r?surkov

Review of attachment 8968721 [details] [diff] [review]:
-----------------------------------------------------------------

extra f? from Neil on the approach

::: accessible/generic/Accessible.cpp
@@ +762,4 @@
>    nsFocusManager* fm = nsFocusManager::GetFocusManager();
> +  if (fm) {
> +    AutoHandlingUserInputStatePusher inputStatePusher(true, nullptr, focusContent->OwnerDoc());
> +    nsCOMPtr<nsIDOMElement> element(do_QueryInterface(focusContent));

It makes sense to replace nsIDOMElement for focusContent->AsElement() and focusContent->IsElement() assertion.

Do you also need to change DocAccessible::TakeFocus version?
Attachment #8968721 - Flags: review?(surkov.alexander)
Attachment #8968721 - Flags: review+
Attachment #8968721 - Flags: feedback?(enndeakin)
Assignee: nobody → eitan
Comment on attachment 8968721 [details] [diff] [review]
Make TakeFocus user initiated. r?surkov

I think that is probably ok.
Attachment #8968721 - Flags: feedback?(enndeakin) → feedback+
(In reply to alexander :surkov from comment #2)
> Comment on attachment 8968721 [details] [diff] [review]
> Make TakeFocus user initiated. r?surkov
> 
> Review of attachment 8968721 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> extra f? from Neil on the approach
> 
> ::: accessible/generic/Accessible.cpp
> @@ +762,4 @@
> >    nsFocusManager* fm = nsFocusManager::GetFocusManager();
> > +  if (fm) {
> > +    AutoHandlingUserInputStatePusher inputStatePusher(true, nullptr, focusContent->OwnerDoc());
> > +    nsCOMPtr<nsIDOMElement> element(do_QueryInterface(focusContent));
> 
> It makes sense to replace nsIDOMElement for focusContent->AsElement() and
> focusContent->IsElement() assertion.
> 
> Do you also need to change DocAccessible::TakeFocus version?

Not for the IME bug, but I'll change it for consistency.
(In reply to Eitan Isaacson [:eeejay] from comment #4)

> > Do you also need to change DocAccessible::TakeFocus version?
> 
> Not for the IME bug, but I'll change it for consistency.

right, you don't need a keyboard for a focused document, and yeah - thanks, consistency is a good thing
Rebased and tweaked test.
Attachment #8968721 - Attachment is obsolete: true
Keywords: checkin-needed
Pushed by ebalazs@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f335f111475
Make TakeFocus user initiated. r=surkov
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1f335f111475
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Duplicate of this bug: 1426104
You need to log in before you can comment on or make changes to this bug.