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

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 UTC