[Bug 13891] New: Allow author scripts that fire before or after every command

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13891

           Summary: Allow author scripts that fire before or after every
                    command
           Product: WebAppsWG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTML Editing APIs
        AssignedTo: ayg@aryeh.name
        ReportedBy: ayg@aryeh.name
         QAContact: sideshowbarker+html-editing-api@gmail.com
                CC: mike@w3.org, public-webapps@w3.org


Ehsan, Ryosuke, Annie, Jonas, and I spoke about this today.  We agreed that
some use-cases for mutation events in editing would best be served by allowing
authors to specify scripts that fire before and after every command,
particularly:

* Replace a command by an entirely custom implementation.  This is useful for
commands that are fired by the UA rather than the author, like insertText or
insertParagraph.  I've been told Safari also automatically lets the user run
bold/italic/etc. via the usual keyboard shortcuts.
* Modify the results of a command.  E.g., adding classes or id's to added
elements.

Actual events that wait for the event loop are inappropriate -- we need these
to run immediately before or after the command.  Scripts that run before the
command need to be able to cancel it for the first use-case.  Scripts that run
after it need info about what it did, like a list of newly-created elements,
for the second use-case.

Speccing the before part should be easy if we provide no info except the
command name and value.  Speccing the after part will require careful work to
decide which nodes to expose.  If new use-cases arise, we can expose more info
for both the before and after events.

This might provide a better solution to some of the use-cases for a mutation
events replacement, but not all of them.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Wednesday, 24 August 2011 19:32:39 UTC