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

getComputedStyle should also be a method of the element #1057

Closed
jcobban opened this issue Feb 12, 2022 · 2 comments
Closed

getComputedStyle should also be a method of the element #1057

jcobban opened this issue Feb 12, 2022 · 2 comments

Comments

@jcobban
Copy link

jcobban commented Feb 12, 2022

Why is it necessary to write:

window.getComputedStyle(element);

rather than the object-oriented:

element.getComputedStyle();

@bathos
Copy link

bathos commented Feb 13, 2022

This method is defined by CSSOM, not DOM, so I don't think this is the right repo for the issue. Looks like it has come up there previously, though: w3c/csswg-drafts#379. (I don't know the history for why it's like this - FWIW I have mistyped it many times myself, forgetting its quirky placement).

@annevk
Copy link
Member

annevk commented Feb 14, 2022

Thanks @bathos. Let's continue discussion in that CSS WG issue.

@annevk annevk closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants