W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: before/after editaction

From: Aryeh Gregor <ayg@aryeh.name>
Date: Wed, 7 Sep 2011 10:16:52 -0400
Message-ID: <CAKA+Axmbefs+eBx7ynryBBa91QOrv-aYWX=3L2B0haWQymEHzQ@mail.gmail.com>
To: olli@pettay.fi
Cc: Ryosuke Niwa <rniwa@webkit.org>, public-webapps <public-webapps@w3.org>, Alex Russell <slightlyoff@chromium.org>, Ojan Vafai <ojan@chromium.org>, Jonas Sicking <jonas@sicking.cc>, Ehsan Akhgari <ehsan@mozilla.com>, Annie Sullivan <sullivan@chromium.org>, Anne van Kesteren <annevk@opera.com>
On Wed, Sep 7, 2011 at 5:47 AM, Olli Pettay <Olli.Pettay@helsinki.fi> wrote:
> What happens if beforeeditaction tears down the document, or
> changes the document significantly or closes the window etc.
> (Those a generic problems with before* events)

It shouldn't make any difference.  The behavior of all the edit
actions is well-defined for any document state.  This kind of thing is
only a problem for something like a mutation event, where the exact
action to be performed is predetermined and might no longer make sense
after DOM changes.  But if you're just doing
document.execCommand("foreColor", false, "red"), then it doesn't
matter what any code does that runs before it.  If it destroys the
document or gets rid of the selection or whatnot, execCommand() will
behave as it normally does in such a situation, probably either doing
nothing or throwing an exception.
Received on Wednesday, 7 September 2011 14:17:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:23 UTC