Add some automated tests for bug 416771, and cleanup a bit the focus code.

RESOLVED FIXED in Firefox 69

Status

()

task
P3
normal
RESOLVED FIXED
28 days ago
16 days ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

unspecified
Firefox 69
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(3 attachments)

No description provided.
Type: defect → task
Priority: -- → P3

Only gtk returns failure ever, and nobody checks the result anyway.

Use an enum class so that it's clear from the caller what it means.

Right now there's some duplicated code with the focus manager and the
DOMWindowFocus event.

Android didn't handle the new framefocusrequested event, so the test-cases in
bug 416771 still didn't work there.

I think using the focus manager codepath everywhere is preferable. I confirmed
manually that the stuff that sent DOMWindowFocus events still works as expected
with this patch (i.e., switching to the right tab when you click on a
notification, etc.).

This fixes it so that it works in Fennec, and it sends the focus events right in
GeckoView Example (i.e., we get here1 properly).

The snippet that Snorp provided on IRC to implement the "bring activity to
front" stuff (startActivity(getIntent())) didn't actually work for me, but I
confirmed that the right message is sent when the focus is requested, and that
we get there.

Depends on D32353

Assignee

Updated

27 days ago
Keywords: leave-open

Comment 5

27 days ago
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a398387437ae
Add a test for switching a tab via window.focus() on a related tab. r=dao

Comment 7

22 days ago
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c0895e6c7343
Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin

I'm pretty sure I had fixed that locally...

Flags: needinfo?(emilio)

Comment 10

20 days ago
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5c17911ac059
Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin

Comment 12

17 days ago
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3648e278fa94
Have a single way of requesting window focus and switching to a tab. r=NeilDeakin,snorp

I suppose we're done here?

Status: NEW → RESOLVED
Closed: 16 days ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.