[svgwg] Add `contenteditable` attribute for SVG text elements

AmeliaBR has just created a new issue for https://github.com/w3c/svgwg:

== Add `contenteditable` attribute for SVG text elements ==
The HTML [`contenteditable` attribute](https://html.spec.whatwg.org/multipage/interaction.html#contenteditable) makes it easy to make interactive inputs out of styled text.  It would be very useful to have it in SVG, too.

Presently, all browsers I've tested support editable SVG text in inline SVG, where a parent HTML element is set to `contenteditable`.  However, it is not very useful in practice:

- You cannot control which elements within the SVG are editable.
- If the user deletes the initial text content, they delete the SVG elements, too (or at the very least, end up with the text input cursor adding content _beside_ the markup instead of inside it).

Microsoft Edge supports the `contenteditable` attribute directly on SVG `<text>` elements in inline SVG, but most other browsers don't.

There are issues and edge cases with `contenteditable` that still need to be resolved in the HTML specs, particularly re accessibility.  However, none of those issues would get any worse by extending the functionality to SVG (so long as the SVG definition refers to HTML & therefore automatically stays in sync).

The feature only applies to interactive environments, so there would be no implementation cost to most non-browser SVG environments. 

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/332 using your GitHub account

Received on Friday, 14 July 2017 18:16:51 UTC