Re: Proposing content-hidden for background-image and img content

On Thu, Aug 18, 2011 at 6:14 PM, Charles Pritchard <chuck@jumis.com> wrote:
> Proposing content-hidden for background-image and img content.
>
> I'd like to see a new option: "visibility: content-hidden", such as,
> <img style="visibility: content-hidden; background: blue" />
>
> Like visibility, the content is not rendered, but, background and border
> fills are.
> A lot of work has gone into background-* paint services.
>
>
> Recently, I used a transparent pixel and an image tag, for compatibility
> with other code.
> <img src="transparent.png" style="background-image: ..." />
>
> I would have otherwise used a div.
> <div role="img" style="background-image: ..." />
>
> My typical html-interop toolkit is visibility, display and opacity. They
> hide the background, so they don't work.
>
> This may help us maintain html semantics like <img> with greater ease.
>
> It's a slightly different type than the existing rendering types,
> it does require a little bit of work, but I hope, an incremental
> improvement, and worth the time.

I assume the use-case you're trying to hit is that you want an <img>
element in your source (for semantics, @alt, etc.), but the actual
image content could be generated by a CSS <image> value.

In this case, the solution will be (once I or Elika pick up the
Generated Content spec in the near future) just providing the image
you want to the 'content' property (likely with some keyword that
indicates it should still be treated as a replaced element; details
are still vague).

~TJ

Received on Friday, 19 August 2011 02:09:27 UTC