W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2012

Re: Optimize setting textContent?

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Wed, 8 Feb 2012 15:58:47 -0800
Message-ID: <CABNRm62s4R78A4VHGJ8Q81D1-YHQebo=4YWU7ccMcdgDZWUJBQ@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: www-dom@w3.org, "Robert O'Callahan" <robert@ocallahan.org>, Stig Halvorsen <stighal@opera.com>
My only concern will be that developers will start using UAs that implement
this new behavior and make assumptions that the text node is always
preserved and create a broken website for users who are using older
browsers.

- Ryosuke

On Wed, Feb 8, 2012 at 5:47 AM, Anne van Kesteren <annevk@opera.com> wrote:

> In https://bugzilla.mozilla.org/**show_bug.cgi?id=725221<https://bugzilla.mozilla.org/show_bug.cgi?id=725221>roc (cc'd, not subscribed to the list) suggests optimizing textContent by
> special casing the scenario where the first child is a text node and the
> string being set is non-empty. This would affect mutation observers and
> makes the setting algorithm more complicated, but it is also a performance
> win (in some implementations at least). Opinions?
>
>
> --
> Anne van Kesteren
> http://annevankesteren.nl/
>
>
Received on Wednesday, 8 February 2012 23:59:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT