W3C home > Mailing lists > Public > www-svg@w3.org > October 2010

Re: why does <text/> have no firstChild with value ""

From: Jeff Schiller <codedread@gmail.com>
Date: Sun, 3 Oct 2010 09:26:59 -0700
Message-ID: <AANLkTi=yGM4t0gWinWVXWHyX8J9GuS1RkVuD80YJtkeC@mail.gmail.com>
To: Jonathan Chetwynd <j.chetwynd@btinternet.com>
Cc: www-svg <www-svg@w3.org>
I don't understand why textContent doesn't solve your problem of 'additional
coding', as I tried to explain in the earlier thread.

Also, you are assuming that <text> will have just text nodes as its
children, but this is an incorrect assumption.  There are lots of different
types of nodes that can go inside a <text> element in SVG.

<text>
  <tspan/>
</text>

<text>
  <title>Label for Foo</title>
</text>

<text>
  <animate.../>
</text>

<text>
  <!-- some comment --/>
</text>

Regards,
Jeff

On Sun, Oct 3, 2010 at 8:16 AM, Jonathan Chetwynd <j.chetwynd@btinternet.com
> wrote:

> why does <text/> have no firstChild with value ""
>
> Can someone please point me to an explanation why the authors inclusion of
> an empty text element does not generate a firstChild with value the empty
> string?
> my issue is that the current methodology requires additional coding and
> complication for the author, and little or no benefit to the UA, afaict.
>
> regards
>
> Jonathan Chetwynd
>
>
> A couple of kindly respondents provided excellent responses offline to my
> original post:
>
> Re: SVG 1.1 Does no text exist in the DOM? or why no eggs?
>
> but I hope this version may be a little clearer.
>
>
>
>
Received on Sunday, 3 October 2010 16:50:31 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:46 GMT