W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2012

Re: [DOM4] Mutation algorithm imposed order on document children

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Tue, 12 Jun 2012 13:14:16 -0700
Message-ID: <CABNRm62fLXKp6Vqwssy9eDZxh6nTFst_49dg2OH-8=Hg7iA2Jg@mail.gmail.com>
To: Elliott Sprehn <esprehn@gmail.com>
Cc: www-dom <www-dom@w3.org>, Ojan Vafai <ojan@chromium.org>, Boris Zbarsky <bzbarsky@mit.edu>
On Tue, Jun 12, 2012 at 1:09 PM, Elliott Sprehn <esprehn@gmail.com> wrote:

> Good question, I assume you mean new
> XMLSerializer().serializeToString(document)?
> FF: Correct order because it forces it on you.
> Webkit: Doctype printed out of order.
> IE9: Doctype always printed in order.
> Opera: Doesn't ever print the doctype. But is the only one to print the
> XML prolog.
> IE9's behavior seems the most sane here since it makes sure the
> serialization is valid in the face of developer error similar to
> serializing the parsed result of <b><a></b></a>.

However, it'll be odd if the order in which nodes appear in DOM and the
order in which they appear in the markup differ. From what you've described
so far, it's okay for IE9 to do this because it doesn't expose DocType
node. I'm not certain it makes sense for us to do the same in the world
where we expose DocType nodes.

- Ryosuke
Received on Tuesday, 12 June 2012 20:15:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:00 UTC