On Wed, Jun 29, 2011 at 6:11 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>
> Jokes aside. I think the way to do this is that the spec should
> introduce the concept of a "compound mutating function". Functions
> like insertBefore, removeChild and the innerHTML setter should claim
> to be such functions. Any other function can also be defined to be
> such a function, such as your execCommand function.
>
> Whenever a mutation happens, the notifications for it is put on a
> list. Once the outermost compound mutation function exits, all
> notifications are fired.
>
I like this idea!
For many rich text editors that "fix up" DOM after the user agent executed
user editing actions or execCommand or more complex apps that need to sync
data dynamically (e.g. collaborative editing), it'll be extremely useful to
get the list of mutations for the action.
- Ryosuke