Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we remove window.blur? #7441

Closed
camillelamy opened this issue Dec 23, 2021 · 7 comments · Fixed by #6315
Closed

Should we remove window.blur? #7441

camillelamy opened this issue Dec 23, 2021 · 7 comments · Fixed by #6315

Comments

@camillelamy
Copy link
Member

The spec says "User agents are encouraged to ignore calls to this blur() method entirely." This is what Chrome does by having this method be a no-op. With the long-term goal of tightening the cross-origin WindowProxy API surface, could we remove this method entirely if user agents are supposed to do nothing when it is called?

@domenic @annevk what do you think?

@domenic
Copy link
Member

domenic commented Dec 23, 2021

Why is removing it better than leaving it as a no-op? Seems like that would cause needless breakage to me.

@Yay295
Copy link
Contributor

Yay295 commented Dec 23, 2021

I'm not entirely sure how these fit together, but would it work to not have blur() on WindowProxy but leave it on Window?

@whatwg whatwg deleted a comment from Eemanali Dec 26, 2021
@whatwg whatwg deleted a comment from Eemanali Dec 26, 2021
@annevk
Copy link
Member

annevk commented Jan 3, 2022

@Yay295 it's a bit unclear what that would mean. A web developer can never access Window directly.

@Yay295
Copy link
Contributor

Yay295 commented Jan 3, 2022

It seems I didn't fully understand how WindowProxy works. I agree with leaving it as it is.

Although rather than being a no-op it might be useful to have it log a warning to the console to potentially help people see it if it's being used and remove it from their code.

@camillelamy
Copy link
Member Author

Could we then change the wording of the spec from "User agents are encouraged to ignore calls to this blur() method entirely." to something that is more prescriptive that this is supposed to be a no-op?

@annevk
Copy link
Member

annevk commented Jan 6, 2022

The blur() method steps are to do nothing.

seems reasonable to me, yeah. (In Firefox it can still do something if you flip a preference, see https://bugzilla.mozilla.org/show_bug.cgi?id=1690798, but it's not clear we want to keep that around and it's not the default configuration.)

@domenic
Copy link
Member

domenic commented Jan 6, 2022

Yeah such a change sounds great to me.

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

Successfully merging a pull request may close this issue.

4 participants