Re: [selectors-api] SVG WG Review of Selectors API

On Wed, 28 Jan 2009 10:55:49 +0100, Henri Sivonen <hsivonen@iki.fi> wrote:

> On Jan 27, 2009, at 00:18, Alex Russell wrote:
>
>> We just need to invent a pseudo-property for elements which can be
>> matched by a ":not([someProperty=<your_ns_here>])".
>
>
> To select SVG elements while avoiding HTML elements of the same name,
> a selector that prohibits the local name foreignObject between an
> ancestor svg element and the selector subject would be good enough.

That wouldn't work for the general case though, since XML elements can occur anywhere in the svg markup. For an example, see Sun's Lively kernel[1].

But it's likely that there are selectors that would work for a majority of cases. Your statement does require that namespaces are not supported in the markup where the selectors API is used, or that it's guaranteed that no such markup occurs even though it may be permitted. Also such elements may be inserted through DOM calls, making the assumption about 'foreignObject' encapsulation invalid.

Cheers
/Erik

[1] http://research.sun.com/projects/lively/index.xhtml

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Wednesday, 28 January 2009 10:16:45 UTC