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

Re: oldNode.replaceWith(...collection) edge case

From: Glen Huang <curvedmark@gmail.com>
Date: Tue, 27 Jan 2015 21:54:08 +0800
Cc: Jonas Sicking <jonas@sicking.cc>, Webapps WG <public-webapps@w3.org>
Message-Id: <6E11D8F8-3419-49C0-8530-537590778218@gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
before/after/replaceWith behave the same in this case is just a side effect of DOM trying to be less surprising and more symmetrical for the curious ones. I doubt most people would even aware they behave the same in this case. Whenever the user cases come, I believe most people will just use replaceWith.

> On Jan 27, 2015, at 8:51 PM, Anne van Kesteren <annevk@annevk.nl> wrote:
> 
> On Thu, Jan 22, 2015 at 11:43 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>> In general I agree that it feels unintuitive that you can't replace a node
>> with a collection which includes the node itself. So the extra line or two
>> of code seems worth it.
> 
> You don't think it's weird that before/after/replaceWith all end up
> doing the same for that scenario? Perhaps it's okay...
> 
> 
> -- 
> https://annevankesteren.nl/
Received on Tuesday, 27 January 2015 13:54:41 UTC

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