W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Should MutationObservers be able to observe work done by the HTML parser?

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Wed, 27 Jun 2012 16:31:47 +0300
Message-ID: <4FEB0B43.1080204@helsinki.fi>
To: Adam Klein <adamk@chromium.org>
CC: Anne van Kesteren <annevk@annevk.nl>, Ian Hickson <ian@hixie.ch>, Jonas Sicking <jonas@sicking.cc>, WebApps WG <public-webapps@w3.org>
On 06/26/2012 11:58 PM, Adam Klein wrote:
> On Wed, Jun 20, 2012 at 12:29 AM, Anne van Kesteren <annevk@annevk.nl <mailto:annevk@annevk.nl>> wrote:
>
>     On Tue, Jun 19, 2012 at 10:52 PM, Olli Pettay <Olli.Pettay@helsinki.fi <mailto:Olli.Pettay@helsinki.fi>> wrote:
>      > end-of-microtask or end-of-task everywhere. And yes, some parsing /
>      > networking details may unfortunately be exposed,
>      > but in a way which should be quite random. Web devs just can't really rely
>      > on network packages to be delivered to parser in
>      > some exact way.
>
>     I think the original solution we had to not expose parser mutations
>     was better. Exposing this can lead to all kinds of subtle bugs that
>     are hard to detect for developers.
>
>
> I take it from your reply that you and I had the same view of what's specced in DOM4.

DOM4 doesn't say anything about this. And because it doesn't special case parser initiated mutations,
those mutations should be there.

> That is, that MutationObservers are not specified to be notified
> of actions taken by the parser.
That would be still very odd. The randomness that there is, is visible to scripts already now.
You can't know the size of network packages, so you can't know exactly now documents are parsed etc.

It would be also odd for scripts which use mutation observer to start working suddenly when
document enters into some state (readyState == "complete" or some such).
During page load user initiated events could cause all sorts of mutations but there wasn't a way to get notified
about those.

> Given that fact, it seems that either the spec should be changed (and by "spec" here I think the required changes are
> in HTML, not DOM), or Firefox's implementation ought to be changed.
>
> Anne, Ian, Olli, Jonas, your thoughts?
>
> - Adam
Received on Wednesday, 27 June 2012 13:32:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT