w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.38k stars 643 forks source link

[cssom] Element.getComputedStyle() #379

Open hfhchan opened 7 years ago

hfhchan commented 7 years ago

Suggest introducing Element.getComputedStyle( [pseudoelt] ) and Element.getUsedStyle( [pseudoelt] ) with proper computed value and used value semantics.

window.getComputedStyle( element, [pseudoelt] ) looks like a procedural function attached on a random object.

dbaron commented 7 years ago

I think the draft had something like this for a while, but it was removed since nobody implemented it. (Although I was mildly interested, but just hadn't gotten to it.)