W3C home > Mailing lists > Public > www-style@w3.org > August 2011

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 18 Aug 2011 19:08:40 -0700
Message-ID: <CAAWBYDD+r+oasPneth-0ObbCe_-bD+Xtqvvnp-pa9Q=ygqP7-Q@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: "www-style@w3.org" <www-style@w3.org>
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).

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:03 UTC