W3C home > Mailing lists > Public > www-style@w3.org > January 2010

Re: Text selector [was Re: breaking overflow]

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 3 Jan 2010 20:28:40 -0600
Message-ID: <dd0fbad1001031828i1b408dai7d576a9e8d625fc9@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
On Sun, Jan 3, 2010 at 7:42 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Jan 3, 2010, at 1:14 PM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
>> What if "bar" is split over two adjacent textnodes in the DOM?
>
> Forgive my ignorance, but when does that happen? Can they be treated as one?

Elements in the DOM contain an array of their children, where
"children" are element nodes, text nodes, and a few others.  Frex,
"<p>foo <i>bar</i> baz</p>" contains at least three nodes - a text
node containing "foo ", a i element node, and a text node containing "
bar".  It's possible, though, for those text nodes to be split into
multiple pieces - the first one could be a text node containing "f"
and another containing "oo ".

I'm not sure how difficult it would be to match across text nodes.  I
feel it's pretty necessary, though - runs of adjacent text nodes are
normally invisible to the user and author, and having things not match
at seemingly random times because, say, a hiccup in the network forced
the parser to pause and end the text node it was constructing, would
be a very bad thing.

~TJ
Received on Monday, 4 January 2010 02:29:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:23 GMT