W3C home > Mailing lists > Public > www-style@w3.org > November 2004

Re: Multiple Background Images

From: Ben Ward <benmward@gmail.com>
Date: Fri, 26 Nov 2004 11:39:46 +0000
Message-ID: <ef5d0f2f0411260339704ea0cb@mail.gmail.com>
To: Ted Shaneyfelt <tvs@hawaii.edu>, www-style@w3.org

> object.style.background[1]="url(image1.jpg)"
> and in another case
> object.style.background="url(image1.jpg)"

I do see the point about issues with existing scripting. However, is
it too unreasonable to expect an author to use backward-compatibility
error trapping in scripts that take advantage of this new syntax?
In the same way as many scripts will check for GetElementById
support at the beginning of a script, surely a script writer could
check whether object.style.background was a single string or an array,
and process accordingly? Obviously a project targeted only at a CSS3
UA wouldn't need this (in what rare occasions that may occur).

Is it within the remit of the CSS WG to specify such things for
related implementations such as JavaScript? Or must that be done
co-operatively with a different group?

I agree that keeping consistency (and in hand, simplicity) is
important in CSS, but the functionality of multiple, layed
backgrounds is not as simple as older CSS. My worry is in
introducing multiple backgrounds using a syntax which is similar
to an existing syntax (font-family), but actually doing something different.
It seems rather like trying to cram the functionality into something
that's not best suited to the task.

Specifically regarding the 'array nature' of multiple backgrounds in a
scripting language - whether indices should be sequential is probably
something that should take into account a related implementation such
as JS. I don't know (having not tried it) how difficult it is to
insert an item into a JavaScript array between two existing indices -
I suspect that it's ugly. I do think that it's highly undesirable to
require complex methods in the UA to support multiple-backgrounds
[background.Insert(string css, int index);], but at the same time
having non-sequential indexing (so to allow z-index style usage) might
result in a scripting implementation creating a huge fixed structure
with unused indices. I don't think it's reasonable for this spec to
make such demands on other technologies. Or maybe it is? I don't know
about past CSS development and the relationship with scripting...

On the face of it, I'd say that indices should be a sequential array.
I wonder if having a one-based array (rather than zero) would be
preferable and more accessible to HTML/CSS developers too (so
background: foo; == background(1): foo;). It may better suit people
that code web design, but may never delve into programming languages
and zero-based representations.
Ben Ward
Received on Friday, 26 November 2004 11:39:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:16 UTC