W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: Proposal: layered CSS background (SVG, png)

From: Bert Bos <bert@w3.org>
Date: Fri, 23 Apr 2010 18:24:43 +0200
To: Kristaps Karlsons <kristaps.karlsons@gmail.com>
Cc: www-style@w3.org
Message-Id: <201004231824.43759.bert@w3.org>
On Thursday 22 April 2010 18:59:53 Kristaps Karlsons wrote:
> Hi, list.
> I have a proposal for further CSS (4?) development. I'll try to keep
> it short as possible.
> Please, keep in mind that (almost) no SVG background support is
> available right now, so this idea would should be actualised only on
> full SVG background support, or layered png support.
> Lets's take a SVG file whitch has 3 groups: group1, group2, group3.
> For example, we would like to show only group1 on our declared
> element:

SVG indeed allows multiple "views" (as they are called in SVG) in a 
single file. But it already defines itself how to display them 
individually. You do that by adding a fragment ID:

    background: url(example.svg#group1)

See, e.g., section 14.3.2 in SVG Tiny 1.2:

That is a better approach than defining handling for specific formats in 
CSS. Any image format (or indeed any other type of resource) that 
defines multiple resources in a single file should also define the URL 
syntax that accesses those resources.

PNG files don't contain multiple images, as far as I know, but its 
sister format MNG does, and it indeed follows this approach. It 
specifies how to use fragment identifiers to display a frame from a 
multi-frame MNG file. See http://www.libpng.org/pub/mng/spec/#URL

The possibilities don't stop there. W3C also has an index of complex 
fragment IDs for XML-based formats, where "complex" means: more than 
just an identifier. They are called "XPointer schemes."

SVG is XML-based and is listed there, but MNG, as a binary format, is 
not. SVG in fact allows extra transformations to be specified after 
the "#". See http://www.w3.org/2005/04/xpointer-schemes/

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Friday, 23 April 2010 16:24:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:45 UTC