Open Bug 1870250 Opened 2 years ago Updated 1 year ago

The focusin event from open shadow DOM does not bubble to parent document

Categories

(Core :: DOM: Events, defect)

Firefox 120
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lingfangao, Unassigned, NeedInfo)

Details

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0

Steps to reproduce:

Clone repo https://github.com/ling1726/shadow-dom-focusin-repro

Setup

  1. run npm install
  2. run npm run dev
  3. navigate to http://localhost:5173/

Steps

  1. click on a button
  2. output should be:
focusin listener - shadow root
focusin listener - document
click listener - shadow root
click listener - document
  1. click on another button
  2. output should be:
focusin listener - shadow root
click listener - shadow root
click listener - document

Actual results:

Each click event is received by the parent document of the open shadow root.

First focusin event is received by the parent document of the open shadow root - all subsequent focusin events are not bubbled up

Expected results:

Each click event is received by the parent document of the open shadow root.

Each focusin event is received by the parent document of the open shadow root

Also adding here that according to MDN https://developer.mozilla.org/en-US/docs/Web/API/Event/composed

All UA-dispatched UI events are composed (click/touch/mouseover/copy/paste, etc.). Most other types of events are not composed, and so will return false. For example, this includes synthetic events that are created without their composed option set to true.
```

I understand the above to assume that `focusin` events that happen inside and open shadow root should bubble up to the parent document
Component: Untriaged → DOM: Events
Product: Firefox → Core

Sean, Adam: Is this anything you'd know something about?

Flags: needinfo?(sefeng)
Flags: needinfo?(avandolder)

I just tested this with today's Nightly and the Nightly from 2023-12-15 and I see we produce the expected behaviour.

lingfangao, do you mind check this again and see if it still reproducible for you? Thanks

Flags: needinfo?(sefeng)
Flags: needinfo?(lingfangao)
Flags: needinfo?(avandolder)
Attachment #9387136 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: