Re: [css-content] Inserting and replacing content with the 'content' property

On Tue, Nov 11, 2014 at 3:23 AM, Florian Rivoal <florian@rivoal.net> wrote:
> On 11 Nov 2014, at 01:22, Bogdan Brinza <bbrinza@microsoft.com> wrote:
>> Since Dave started a thread on de-outofdatifying CSS Generated Content
>> Module L3 – we’ve found a recent related interoperability issue I wanted to
>> discuss.
>>
>> We’ve got reports that Google Glass website [1] doesn’t show GLASS logo on
>> IE/Firefox, but does show it on Chrome. Investigation showed that actual
>> image is inserted as content of an <a> element [2].
>>
>> To my understanding this is spec’d in css-content spec [3], and as far as I
>> can understand this was implemented in WebKit at some point. However it’s
>> not really clear what’s the expected behavior here – pseudo elements address
>> many questions on actual content insertion and are supported more
>> universally.

It is indeed intended that 'content' work on arbitrary elements.  That
said, the Glass website is using it in an absolutely terrible way -
it's not doing some sort of CSS-based *replacement* of content (to
upgrade text to an image, for example), it's just, for no reason that
I can ascertain, providing the element with content through CSS rather
than with an <img>.  That's bizarre and stupid; there's no reason to
have an empty <a>.

> Presto (old Opera engine) supports ‘content’ on arbitrary elements both for
> image and textual values. Chrome supports images values both on elements and
> pseudos, but limits its support for textual values to pseudos.

That's an incredibly weird restriction.

> This snippet will show “hello” in old Opera, but not in Chrome
> <style> p {content: "hello"} </style>
> <p>
>
> Given that there is also support for ‘content’ on arbitrary elements in
> print oriented CSS renderers, it feels like we should preserve the behaviour
> in the spec, and get it supported more widely.

Yes.

> At the same time, I seem to remember that there were web-compat concerns
> back at Opera, and this could explain why Chrome does not support textual
> values on elements.

Let's play with it?

~TJ

Received on Wednesday, 12 November 2014 01:45:54 UTC