Skip to content

Allow a Window as the target of "fire a focus event" - #12875

Open
zcorpan wants to merge 2 commits into
mainfrom
zcorpan/fire-a-focus-event-window
Open

Allow a Window as the target of "fire a focus event"#12875
zcorpan wants to merge 2 commits into
mainfrom
zcorpan/fire-a-focus-event-window

Conversation

@zcorpan

@zcorpan zcorpan commented Sep 1, 2026

Copy link
Copy Markdown
Member

"Fire a focus event" was defined as taking an element, but the focus update steps invoke it with a Window object when the entry is a Document, and a Window has no node document to get the view attribute's value from.

Fixes #12866.

(See WHATWG Working Mode: Changes for more details.)

"Fire a focus event" was defined as taking an element, but the focus
update steps invoke it with a `Window` object when the entry is a
`Document`, and a `Window` has no node document to get the `view`
attribute's value from.

Fixes #12866.
@Ms2ger

Ms2ger commented Sep 1, 2026

Copy link
Copy Markdown
Member

While you're here: I'm not too fond of the single-letter variables

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modulo my nit and @Ms2ger's nit. So we never call this with a Document object then?

Comment thread source Outdated
@zcorpan

zcorpan commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

@annevk no, it's only called from focus update steps with either an element or a Window.

@zcorpan

zcorpan commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Are WebKit and Chromium ok with switching from Event to FocusEvent in the Window case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

"fire a focus event" expects an element as argument, but is called with a Window

3 participants