Re: [csswg-drafts] [cssom] getComputedStyle only supports ::before/::after

I think it makes sense to support all pseudo-elements which the user-agent supports, and it probably should also be specified that what should happen when the pseudo-element is not supported.

Personally I think throwing an exception (maybe `TypeError`) is better than returning the style of the element, but I can accept argument on that.

Note that, Firefox currently throws `NS_ERROR_NOT_AVAILABLE` when getting property value from the object returned from gCS in that case, and gCS itself doesn't throw, which, I would think, is a bug. I think gCS should throw, or everything should work smoothly.

FWIW, there could be tricky cases for supporting returning all properties on all pseudo-elements, for example, since many pseudo-elements have only limited properties applied, user-agents may want to avoid computing the rest if possible, and may optimize their storage, which can lead to observable difference on returned value.

Also some properties which use used value rather than computed value as resolve value might be tricky in some cases, although it isn't clear to me what the cases would be.

-- 
GitHub Notification of comment by upsuper
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2149#issuecomment-354529370 using your GitHub account

Received on Saturday, 30 December 2017 05:53:12 UTC