Re: [CSS OM] list of issues

Le 01/06/11 07:40, Sylvain Galineau a écrit :

> [Daniel Glazman:]
>> 7. getComputedStyle
>>      One of the big lacks of the existing CSS OM is the impossibility to
>>      get the computed style of an element if a dynamic pseudo-class is
>>      applied. It would be really cool to extend getComputedStyle() and
>>      allow for instance ":hover" in the second parameter.
> That'd be cool; I'd also appreciate a clear definition of what the second
> argument can be be ? Which one of these should be supported :
> 	a) "first-line"
> 	b) ":first-line"
> 	c) "::first-line"

That's undefined at this time :-( But if we read the CSS OM spec with a
strict eye, it says the second parameter of getComputedStyle() is a
pseudo-element. "first-line" is not a pseudo-element; ":first-line" and
"::first-line" are...
I would say both b and c are the correct answer. Please note that for
recent pseudo-elements, only the double-colon version should be ok.

> WebKit allows all of the above. IE9, Firefox 4 and Opera 11 will only return
> the pseudo-element's style for b) and c). Given a) they return the style of
> the element passed as first argument instead. (All browsers also do the latter
> given an invalid or unknown name such as ":::first-line". Interestingly, Firefox
> throws an out of memory exception for the latter).

Eh :-) File a bug on ?-)


Received on Wednesday, 1 June 2011 06:27:40 UTC