Re: [cssom] Proposal for obtaining robust style information via Javascript - getStyle()

On Fri, Feb 8, 2013 at 3:55 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> What about instead providing access to an object that represents the
> pseudo-element:
>
>   element.pseudo("::before").computedStyle.color

I think this is the ideal solution.  It's simple, unlikely to have
naming clashes, and it allows us a beautiful extension point for doing
things in the future like adding event handlers to pseudo-elements.

> Or if we event wanted to special case a few standard pseudo-elements:
>
>   element.before.computedStyle.color

Horrible idea. ^_^  Much more likely to have naming clashes, which
means we also have to do a compat study before naming any new
pseudo-element forever.  There is absolutely no reason to ever
special-case just a few "standard" pseudos.

~TJ

Received on Saturday, 9 February 2013 17:04:37 UTC