W3C home > Mailing lists > Public > www-svg@w3.org > December 2007

Re: is this switch valid?

From: Erik Dahlström <ed@opera.com>
Date: Tue, 11 Dec 2007 20:25:28 +0100
To: ~:'' ありがとうございました。 <j.chetwynd@btinternet.com>
Cc: "www-svg List" <www-svg@w3.org>
Message-ID: <op.t26qwqovdhsuf5@gnorps.palace.opera.no>

On Mon, 10 Dec 2007 18:34:48 +0100, ~:'' ありがとうございました。  
<j.chetwynd@btinternet.com> wrote:

> erik,
> I had originally used:
>    <foreignObject class="audio" xlink:href="sound/en/read.mp3">
> which indeed worked for a while in Opera.

Without the version and build numbers I can't verify that statement. Opera  
doesn't support mp3 files in general though, so that would depend on the  
installed plugins and/or operating system. I'd be surprised if the same  
didn't apply to Firefox as well.

> However this doesn't validate, and as it stopped working recently in the  
> nightlies.

Does it work if instead of directly referencing the mp3 make it indirect:
<foreignObject xlink:href="foo.html" width="100" height="100"/>

<html><body><object data="foo.mp3"/></body></html>

> Please can you confirm whether in your opinions this is valid SVG 1.1  
> and whether Opera will support.
> it's vital that a single code sample works across UAs

It's valid xml, but not valid SVG 1.1 if you go by the official 1.1 DTD  
only. Nothing really prevents you from putting any attributes you like on  
any element, except for validators that validate against a schema or a DTD  
without accepting additional attributes or elements. In SVG 1.1-only  
viewers the xlink:href will mean that the element has such an attribute,  
but won't mean that it's handled in the same way it is in SVG 1.2 Tiny  
viewers since SVG 1.2 Tiny gives 'xlink:href' on 'foreignObject' a defined  


> regards
> Jonathan Chetwynd
> Accessibility Consultant on Media Literacy and the Internet
> On 10 Dec 2007, at 12:24, Erik Dahlström wrote:
> On Mon, 10 Dec 2007 11:53:14 +0100, ~:'' ありがとうございました。  
> <j.chetwynd@btinternet.com> wrote:
>> Erik,
> ...
>> but can you advise me whether or when Opera will support the audio with  
>> CSS as used in http://www.peepo.co.uk
> I think what you might be experiencing here is some difference in how  
> foreignObject is supported in browsers.
> In SVGT12 there is an xlink:href attribute on the foreignObject element,  
> in SVG 1.1 it lacks this.
> If you have an xlink:href attribute that will always be used instead of  
> the child elements, according to SVGT12.
>  From looking at the source of your site I see you make some assumptions  
> that audio can be handled in foreignObject by passing it an xlink:href  
> to some audio file. That's not supported in Opera 9.x, but you could use  
> the audio element in SVGT12 if you use the special video builds of  
> Opera[1].
> Here are some suggestions:
> - if you want it to work in Opera 9.2 and up: make a small html file  
> with an object element linking to your audio file. Then reference this  
> in foreignObject, like this <foreignObject  
> xlink:href="audio.html">...</foreignObject>
> - if you want it to work in Opera 9.5 and up: use the audio element  
> (switch on requiredFeature="http://www.w3.org/Graphics/SVG/feature/ 
> 1.2/#Audio") or remove the xlink:href on the foreignObject so that the  
> child elements are processed (I think this is what Firefox does, since I  
> can't get any xlink:href content to show up there)
> Your best bet for compatibility with current browsers is the first  
> option I think, and you should make sure the child elements of the  
> foreignObjects and the files you reference are the same.
> Cheers
> /Erik
> [1] http://dev.opera.com/articles/view/a-call-for-video-on-the-web- 
> opera-vid/

Erik Dahlstrom, Core Technology Developer, Opera Software
Received on Tuesday, 11 December 2007 19:25:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:17 UTC