W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2017

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

From: Xidorn Quan via GitHub <sysbot+gh@w3.org>
Date: Sat, 30 Dec 2017 05:53:09 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-354529370-1514613188-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:21 UTC