W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: before/after editaction

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Thu, 20 Oct 2011 18:57:02 -0700
Message-ID: <CABNRm60j7vnBs6c0n=rB68-VJTsuBrD3JzdWLGZpd_kaHUXBOg@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: Jonas Sicking <jonas@sicking.cc>, Darin Adler <darin@apple.com>, public-webapps <public-webapps@w3.org>
On Thu, Oct 20, 2011 at 6:35 PM, Ojan Vafai <ojan@chromium.org> wrote:

> On Thu, Oct 20, 2011 at 1:06 PM, Ryosuke Niwa <rniwa@webkit.org> wrote:
>
>> On Thu, Oct 13, 2011 at 7:20 PM, Ojan Vafai <ojan@chromium.org> wrote:
>>
>>> Overall I really like the proposal (both having the events and Jonas's
>>> addition to include them in the undo transaction). We'd fire the
>>> afterEditAction exactly everywhere we currently fire the input event though.
>>> Instead of adding two new events, could we instead add a beforeInput event
>>> as the beforeEditAction. Then add to both beforeInput and input an "action"
>>> property that is the edit action that was taken.*
>>>
>>
>> Yeah that'll be clean and neat way to support this. We probably need to
>> add two properties though because some execCommand takes string value.
>>
>>  The only downside I see to reusing input is that it might complicate
>>> Jonas's suggestion to include edits during the afterEditAction in the undo
>>> transaction. Although, my intuition is that there is *not* web content that
>>> depends on script executed during the input event not entering the undo
>>> stack.
>>>
>>
>> Right. I think we probably need to avoid firing them inside a transaction
>> to maintain the backward compatibility.
>>
>
> I really don't expect this to cause compat problems. I think we can move
> forward with whichever API we think is best assuming no compat problems and
> revise it should we hit compat problems once vendors start implementing it.
>

I don't think we can make such an assumption. People mutate DOM on input
event all the time:
http://codesearch.google.com/#search/&q=%20oninput=&type=cs

Including any DOM mutations in the on-going transaction would mean that UA
will end up trying to revert those changes since the entire document shares
the one undo scope by default, and may end up mutation DOM in unexpected
ways.

- Ryosuke
Received on Friday, 21 October 2011 01:57:59 GMT

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