Closed Bug 1675484 Opened 5 years ago Closed 4 years ago

iframe.onfocus invoked upon iframe.focus() for out-of-process iframes

Categories

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

defect

Tracking

()

RESOLVED FIXED
89 Branch
Fission Milestone M8
Tracking Status
firefox89 --- fixed

People

(Reporter: hsivonen, Assigned: edgar)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When calling iframe.focus() on an OOP iframe, Chrome and Fission invoke iframe.onfocus. However, we don't invoke it for in-process iframes. Test case coming up in bug 1662772.

Severity: -- → S3
Priority: -- → P2
See Also: → 1662772
Summary: iframe.onfocus not invoked upon iframe.focus() for in-process iframes → iframe.onfocus not invoked upon iframe.contentWindow.focus() for in-process iframes
Summary: iframe.onfocus not invoked upon iframe.contentWindow.focus() for in-process iframes → iframe.onfocus not invoked upon iframe.focus() for in-process iframes

It seems like the difference is probably from the elementToFocus and newWindow setup in nsFocusManager::SetFocusInner,

  • In-process iframe case: the newWindow would be the contentWindow of iframe, and elementToFocus would be the mFocusedElement in contentWindow.
  • OOP iframe case: the newWindow would be the window that contains the iframe, and elementToFocus would be the iframe itself.

Per discussion with Anne, spec-wise this looks like a Fission (and partially Blink) bug after all, and there's no spec basis for the event firing. (We should also consider the possibility that something expects the event to fire as in Blink compat-wise by now.)

Summary: iframe.onfocus not invoked upon iframe.focus() for in-process iframes → iframe.onfocus invoked upon iframe.focus() for out-of-process iframes

Moving it to MVP since the current behavior is the same as Chrome.

Fission Milestone: --- → MVP

We should be able to fix this sooner in M8.

Fission Milestone: MVP → M8
Assignee: nobody → echen
Attachment #9212192 - Attachment description: WIP: Bug 1675484 - iframe.onfocus should not be invoked when focus moves to out-of-process iframes; r=hsivonen → Bug 1675484 - iframe.onfocus should not be invoked when focus moves to out-of-process iframes; r=hsivonen
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab57f439bce3 iframe.onfocus should not be invoked when focus moves to out-of-process iframes; r=hsivonen
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: