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

Re: Optimize setting textContent?

From: Robert O'Callahan <robert@ocallahan.org>
Date: Thu, 9 Feb 2012 08:24:18 +1300
Message-ID: <CAOp6jLa6NDopT6OXzzG2ixjjiPykUtgXV9JxyvnYFDr5PiZ0xg@mail.gmail.com>
To: olli@pettay.fi
Cc: Anne van Kesteren <annevk@opera.com>, www-dom@w3.org, Stig Halvorsen <stighal@opera.com>
>
> Quite horrible special case. APIs should be consistent whenever possible.
>

Can you think of a realistic scenario where developers would be burned by
this? I think someone would have to retain a reference to the old text
node, set textContent on the element, then do something with the old text
node and expect it to NOT have changed. Seems a bit unrealistic to me.

On the other hand, the practical benefit is real.

Rob
-- 
"If we claim to be without sin, we deceive ourselves and the truth is not
in us. If we confess our sins, he is faithful and just and will forgive us
our sins and purify us from all unrighteousness. If we claim we have not
sinned, we make him out to be a liar and his word is not in us." [1 John
1:8-10]
Received on Wednesday, 8 February 2012 20:27:55 GMT

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