W3C home > Mailing lists > Public > www-archive@w3.org > July 2015

Re: A question about Range#insertNode

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 7 Jul 2015 15:27:46 +0200
Message-ID: <CADnb78jM6g=k=T-seySONxDMgxOXXkJ_nFDxVqx=CqGshxrzYA@mail.gmail.com>
To: Ms2ger <ms2ger@gmail.com>, Aryeh Gregor <ayg@aryeh.name>
Cc: www-archive <www-archive@w3.org>
On Tue, Jul 7, 2015 at 12:48 PM, Ms2ger <ms2ger@gmail.com> wrote:
> Step 7 of <https://dom.spec.whatwg.org/#concept-range-insert> reads
>
>> If /range/’s start node is a Text node, split it with offset
>> /range/’s start offset, set /referenceNode/ to the result, and set
>> /parent/ to /referenceNode/’s parent.
>
> In this case, /referenceNode/ has been set to /range/’s start node
> (step 3), and /parent/ has been set to /referenceNode/’s parent (step
> 5). The split algorithm returns a node with the same parent as its
> argument, so I believe that this step doesn't actually change /parent/.
>
> Could you confirm and maybe add a note to the spec here?

You mean removing setting /parent/ again? Seems conrrect. I wonder if
Aryeh has a second to take a look since I believe he wrote that
algorithm.


-- 
https://annevankesteren.nl/
Received on Tuesday, 7 July 2015 13:28:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:35:20 UTC