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

On Thu, 3 Jul 2003, James Craig wrote:
> What about specifying something to display the way a 'title' attribute
> currently would in HTML?

There have been three proposals I'm aware of:

   myImage { tooltip: attr(title); }

   myImage::tooltip { content: attr(title); }

   myImage { binding: url(tooltip.xml#from-title); }

I suppose others come to mind:

   myImage { binding: tooltip; tooltip: attr(title); }

   myImage:hover::before { content: attr(title); display: tooltip; }

   myImage:hover::alternate { content: attr(title); flow: tooltip; }
   @tooltip { ... }

...where 'flow' is the new name for 'move-to'.

Of the above:

 * the first is the simplest, but least powerful,

 * the second is slightly more powerful but is largely open to the UA for
   details such as placement, timing, and so forth,

 * the third is by far both the most complicated and the most powerful as
   it also gives the author the ability to control how long the popup
   stays up, where it appears, and pretty much everything else about it,
   but unfortunately requires significantly more work from the author,

 * the forth is as powerful as the third for authors who want it but as
   simple as the first for authors who don't,

 * the fifth is pretty much equivalent to the second but follows more in
   the line of the 'display: marker' model and is thus unlikely to be

 * and the sixth is pretty much equivalent to the second but more

Personally I prefer the fourth. One might argue that CSS shouldn't be
talking about this kind of stuff, though, and I don't think the WG has
really thought about it much.

> Should there also be some way to specify size based on included
> attributes like width and height?

You want:

   width: attr(width, px);

As David said, the extended 'attr' form isn't described anywhere public
yet; I think I wrote a proposal up once but there hasn't been a
publication of the relevant spec. The CSS3 Color module has a sneak
preview, though:

   beam { background-color: attr(kind, color); }


   <beam kind="yellow"/>

>> Why do they need any special casing?
>>    video { content: url(movie.mpeg); }
>>    flash { content: url(game.swf); }
> What about functional attributes like pluginspage or functional child
> elements like <param>?

I think those _should_ be handled as fragment identifiers for the relevant
MIME types. For example, XML has XPointer, XFrames has its own wacky
fragment identifier thing, HTML has id fragment identifiers, so why
shouldn't other MIME types do the same:;text=hello%20world

...or something. But that's not in the realm of CSS, obviously.

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.                         `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 4 July 2003 09:04:25 UTC