W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

Re: [whatwg] Mutation Observer arguments format

From: Brian Kardell <bkardell@gmail.com>
Date: Mon, 11 Mar 2013 17:44:46 -0700
Message-ID: <CADC=+jcUMRH+U0Gq-80h7fAvFUqVB7zSXtG2uWPGugeF1PAnWA@mail.gmail.com>
To: Alex Russell <slightlyoff@google.com>
Cc: Adam Klein <adamk@google.com>, Jonas Sicking <sicking@mozilla.com>, whatwg <whatwg@lists.whatwg.org>, Rafael Weinstein <rafaelw@google.com>, "Olli@pettay.fi" <Olli@pettay.fi>
On Mar 11, 2013 8:41 PM, "Alex Russell" <slightlyoff@google.com> wrote:
>
> Hi all,
>
> I had a moment today while trying to use Mutation Observers where it
wasn't
> clear to me what bits of the configuration passed to observe() are
required
> and which are configuration about required values. In particular, the
names
> "subtree" and "childList" feel like they should be peers, but it seems
> they're not.
>
> After a quick chat with Adam Klein, it seems like it might be easier to
> understand if the "childList", "attributes", and "characterData"
attributes
> of the configuration bag were rolled into a single value, e.g. "type" or
> "types". The observe() might then be written as:
>
>     observer.observe(node, { types: ["attributes", "childList"], subtree:
> true });
>
> This breaks the types of observation into a separate bag from the
> configuration for those observations.
>
> Thoughts?

Yes, i really like it :)
Received on Tuesday, 12 March 2013 00:45:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 12 March 2013 00:45:11 GMT