W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2009

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 28 Jan 2009 11:40:25 -0500
Message-ID: <49808A79.2010800@mit.edu>
To: Giovanni Campagna <scampa.giovanni@gmail.com>
CC: public-webapps@w3.org

Giovanni Campagna wrote:
> 2009/1/28 Boris Zbarsky <bzbarsky@mit.edu>:
>> Giovanni Campagna wrote:
>>> well, assuming that an author will need to match elements across
>>> multiple namespaces, it will be easier to use XPath (that also is
>>> compatible across multiple browsers) than to use horrible workarounds
>>> like "svg :not(foreignObject) *[href]" (all svg links)
>> I should note that that selector doesn't actually work to select things that
>> are not inside a foreignObject...  Offhand, I see no way to do that, in
>> fact.
> Why shouldn't it?

   <svg xmlns="http://www.w3.org/2000/svg">
         <foo xmlns="" href="This is my random href attribute"/>

The <foo> element matches the "svg :not(foreignObject) *[href]" 
selector.  Indeed, "*[href]" matches the <foo> element, 
":not(foreignObject)" matches the <g>, and "svg" matches the <svg>.

> It is the summary of the email Lachlan linked, with pros and cons of
> various solutions.

Oh, ok.  So that was just reiterating what had already been said.  Gotcha.

> It is not only SVG, it is any markup language that may be mixed to
> build a compound document.

There is a lot less of a problem with languages that don't have 
colliding localNames.

Received on Wednesday, 28 January 2009 16:41:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:13 UTC