W3C home > Mailing lists > Public > www-style@w3.org > June 2002

Re: Rollover-image Property

From: Stuart Ballard <sballard@netreach.com>
Date: Thu, 20 Jun 2002 10:32:41 -0400
Message-ID: <3D11E789.7030004@netreach.com>
To: Manos Batsis <m.batsis@bsnet.gr>
CC: www-style@w3.org

Manos Batsis wrote:
> 
>>One thing you can't easily do right now is size an element to the 
>>natural size of its background image.
> 
> 
> That has nothing to do with a hypothetical rollover-image property ;-)

It explains one reason why currently using background-image and :hover 
is unsatisfactory compared to <img> and modifying the src property, but 
point taken.

> This is interesting; however it steps outside the background module
> area.

I don't recall this discussion being limited to the background module, 
or any other module.

> Yes, as I was saying, what you are talking about is actually DOM content
> included by CSS rules...

I don't think this is necessarily so: ::before and ::after include 
"content" by CSS rules, but it isn't DOM content.

>>(1) Allowing the "content" property to take a url() of an image as an 
>>argument, and also allowing it to apply to any element, 
>>instead of just 
>>the before and after pseudos. Anything in the "content" 
>>property would 
>>completely replace the regular content of the element; OR
> 
> 
> This is already covered by [1] but accessibility issues arise.

The first part of the sentence is covered by the spec, but the second 
part isn't - content can only apply to ::before and ::after. This 
proposal requires it to apply to anything.

Also it's not clear (to me at least) whether the spec allows 
interpreting attr(X) as a URI, rather than just text.

> It all turns down to where CSS should stop.

I agree.

> IMHO this is clearly a DOM
> issue so you should implement it with ECMAScript or something.
> The only place in CSS I would like that to be is through Behavioral
> Extensions.

I think CSS has already stepped well over the hard-and-fast line you're 
trying to draw here. Just some examples of CSS capabilities that fall 
into the same category as what I'm proposing:

- ::before and ::after, of course. They add what would normally be 
considered "DOM content" through CSS rules.
- list-style-image. That allows effective insertion of an arbitrary 
image into the document, but only at a particular point and with 
particular restrictions relevant to list display. It's telling that 
Mozilla implements its toolbar buttons by setting list-style-image on 
the <button> element - clearly a button isn't a list in any sense, but 
there's such a demand for the ability to put in an arbitrary image that 
they were willing to live with the "listiness" restrictions.
- :hover is already "behavioral". Considering that you can do popup 
menus and all kinds of dynamic display just by judicious use of :hover, 
I don't think it's such a stretch to want to be able to use :hover to 
update an image's display.

Consider also that <img> one of very, very few HTML elements that are 
used inside <body> (except for forms) whose display behavior is entirely 
impossible to express using CSS. In fact, except for forms and <script>, 
it really seems like <img> and its counterparts <object>, <embed> and 
<iframe> are the only ones that CSS completely falls over on. <img> is 
certainly the most commonly-used element that can't be expressed in CSS.

> Others may have other views of course ;-)

:)

> [1] http://www.w3.org/TR/REC-CSS2/generate.html#content

Thanks,
Stuart.

-- 
Stuart Ballard, Programmer
NetReach - Internet Solutions
(215) 283-2300, ext. 126
http://www.netreach.com/
Received on Thursday, 20 June 2002 10:32:45 GMT

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