Closed Bug 1653160 Opened 2 years ago Closed 2 years ago

focus handling seems to be broken in fission window

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Fission Milestone M6b
Tracking Status
firefox82 --- fixed

People

(Reporter: hiro, Assigned: hsivonen)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached file t.html (obsolete) —

I am bit confused, it may not be a problem at all.

Steps to reproduce

  1. Open https://hsivonen.fi/fission-host.html
  2. Click somethere in one of iframes there
  3. You will see a "iframe [object Window] focus"
  4. Click again somewhere in the same iframe
  5. You will see a pair of "iframe [object Window] blur" and "iframe [object Window] focus"

In non Fission window, you will never see the pair of "blur" and "focus".

Attachment #9163928 - Attachment is obsolete: true

Sorry the attachment in comment 0 is not necessary at all. I was initially thinking the issue happens only in nested iframes.

Henri is looking into Fission focus and bug 1613054 may be related.

Blocks: fission-dogfooding
No longer blocks: fission
Fission Milestone: --- → M6b
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → hsivonen
Severity: S3 → S2
Status: NEW → ASSIGNED
Priority: P3 → P2

Preliminary guess: Upon click, we always try to "raise" the PuppetWidget window of the OOP iframe even if it already has focus.

It looks like we need some check that makes sense for OOP iframes here, where we even have a comment hinting at a problem:
https://searchfox.org/mozilla-central/rev/d54210d490ef335b13fc1fcac817525120c8c46b/dom/base/nsFocusManager.cpp#2738

The obvious solution is checking against the focused browsing context, but I need to think more carefully about the case where the OOP iframe tree is deeper.

(In reply to Neha Kochar [:neha] from comment #2)

Henri is looking into Fission focus and bug 1613054 may be related.

At this point, it looks like this in unrelated to bug 1613054.

The currently-attached patch leaves the observable order of the click and focus events in the OOP iframe reversed compared to the non-Fission case. Let's leave potentially changing that as a follow-up.

Blocks: 1660805

(In reply to Henri Sivonen (:hsivonen) from comment #7)

The currently-attanche patch leaves the observable order of the click and focus events in the OOP iframe reversed compared to the non-Fission case. Let's leave potentially changing that as a follow-up.

Filed as bug 1660805 (bug not introduced by the fix here).

Attachment #9171715 - Attachment description: Bug 1653160 test - Test clicking and already-focused OOP iframe. → Bug 1653160 test - Test clicking and already-focused OOP iframe and test moving focus between nested OOP iframes.

(In reply to Henri Sivonen (:hsivonen) from comment #3)

I need to think more carefully about the case where the OOP iframe tree is deeper.

Per discussion with Neha, spinning this off into a follow-up: bug 1661227.

Blocks: 1661227
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b162b405a551
Avoid re-raising the PuppetWidget of an already-focused OOP iframe upon click. r=nika
https://hg.mozilla.org/integration/autoland/rev/998f1372ebe0
test - Test clicking and already-focused OOP iframe and test moving focus between nested OOP iframes. r=nika
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Regressions: 1661628
You need to log in before you can comment on or make changes to this bug.