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

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

From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Wed, 28 Jan 2009 18:01:01 +0100
Message-ID: <65307430901280901q2a00e04eqa2f3e8043952d98@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org

2009/1/28 Boris Zbarsky <bzbarsky@mit.edu>:
> 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">
>    <g>
>      <foreignObject>
>        <foo xmlns="" href="This is my random href attribute"/>
>      </foreignObject>
>    </g>
>  </svg>
> 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>.
One point in favour of namespace support then!

>> 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.
Mix HTML with SMIL and you get duplicate <audio> and <video>. Mix HTML
with XForms and you get duplicate <input>,<textarea>,<select>,<label>.
Is not only SVG

Received on Wednesday, 28 January 2009 17:01:37 UTC

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