This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12533 - Being able to control what the user agent is creating on a command would be useful. Otherwise I have to listen to DOM mutation events or parse my editable text to find out.
Summary: Being able to control what the user agent is creating on a command would be u...
Status: RESOLVED DUPLICATE of bug 13891
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Aryeh Gregor
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 12:35 UTC by contributor
Modified: 2011-11-07 20:29 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2011-04-20 12:35:25 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Section: http://www.whatwg.org/specs/web-apps/current-work/#editing-apis

Comment:
Being able to control what the user agent is creating on a command would be
useful. Otherwise I have to listen to DOM mutation events or parse my editable
text to find out.

Posted from: 130.149.33.2
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Comment 1 Aryeh Gregor 2011-04-21 19:51:58 UTC
I'm currently working on speccing editing APIs, so I'll assign this bug to myself.  Such a new feature is almost certainly out of scope for HTML5, but I don't know of a better component right now, so I'll leave it as HTML5.  Maybe one day we'll get an HTML6 component.  Currently I'm working on defining the existing API, but at some point I might work on speccing new features.

I've seen this use-case in practice.  For instance, one editor I looked at wanted to add custom attributes to images inserted using insertImage.  It did so by adding the image, then iterating over all images in the edit window and modifying any with the right src.

Another editor I looked at used insertImage as an insertHtml workaround for IE, by inserting an image with an improbable src, then using the equivalent of querySelector("[src=MYSRC]") (with shims) to find it, then removing it and inserting the HTML in its place.


The obvious way to do this would be to allow commands to return some command-specific value (like an HTMLImgElement for insertImage).  I don't know if we can compatibly make execCommand() return anything, though.  Any suggestions for syntax?
Comment 2 Michael[tm] Smith 2011-08-04 05:15:47 UTC
mass-move component to LC1
Comment 3 Aryeh Gregor 2011-11-07 20:29:05 UTC

*** This bug has been marked as a duplicate of bug 13891 ***