W3C home > Mailing lists > Public > www-style@w3.org > July 2003

Re: "display: image;" for CSS styling of images embedded in XML documents?

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 3 Jul 2003 11:07:32 -0700 (PDT)
To: James Craig <work@cookiecrook.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.56.0307031103341.9100@dhalsim.dreamhost.com>

On Thu, 3 Jul 2003, James Craig wrote:
>
> XML example:
>
>    <myImage mySource="img/foo.gif" myAlt="foo" />
>
>    myImage {
>      display: image;
>      text-alternative: attr(myAlt);
>      source: attr(mySource);
>      }

With the CSS3 Generated Content draft, that would be:

   myImage { content: attr(mySource, url), attr(myAlt); }


> I thought of an issues that might arise. For example, should the source
> path be relative to the document or stylesheet? Since it's from the
> document, I would say document, but URL values from a stylesheet are
> usually evaluated to be relative to the stylesheet.

The form "attr(mySource, url)" will be resolved relative to the document.


> Should there be a mime-type spec in the CSS for these images?
>
>    myImage[mySource$=".gif"] {
>      mime-type: "image/gif";
>      }
>    myImage[mySource$=".png"] {
>      mime-type: "image/png";
>      }

I don't understand what this means.


> If this idea pans out, what kind of proposals might there be for
> displaying other kind of things that would typicially be held in HTML
> <object> elements?

Why do they need any special casing?

   video { content: url(movie.mpeg); }

   flash { content: url(game.swf); }

   test { content: url(test.svg), url(test.html), url(test.mathml),
                   url(test.smil); }

Of course there's nothing stopping UAs right now from implementing:

   body { background: url(test.swf); }

Cheers,
-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 3 July 2003 14:07:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:22 GMT