Re: [whatwg] Move contentEditable/isContentEditable from HTMLElement to Element?

On Jul 2, 2014, at 4:01 AM, Ryosuke Niwa <rniwa@apple.com> wrote:

> On May 15, 2014, at 10:01 AM, Elliott Sprehn <esprehn@chromium.org> wrote:
> 
>> On Tue, May 13, 2014 at 11:21 AM, Ian Hickson <ian@hixie.ch> wrote:
>> 
>>> I would feel more comfortable putting things on SVG, MathML, and HTML
>>> explicitly.
>>> 
>> I don't think we want contenteditable in SVG or MathML. Almost all of the
>> operations don't make sense. What does intending in SVG do? What does
>> making something italic? What happens when you hit enter? We can't just
>> insert a new line in SVG, does it add some space between all the shapes?
>> Where does your caret actually appear?

The question about “hitting enter” is valid. However, these kind of questions don’t seem to be clarified for HTML either. Every UA is doing something different. To the other questions: just text in <text>, <textPath> and <tspan> are affected. In all other cases the general processing rules of SVG apply.

>> 
>> We might want some new kind of Web Editing API, but
>> contenteditable/execCommand are both pretty specific to HTML.
> 
> contenteditable isn't just for execCommand.  We could simply enable plaintext editing inside SVG text element for example.
> 
> However, I would like to know what use cases and problems Dirk is trying to solve by moving these attributes from HTMLElement to Element.  Dirk, could you elaborate on that?

If you add contentEditable to an HMTL element and an SVG element is an descendant of this element, SVG text is editable as well. If you add contentEditable to an SVGElement itself, it doesn’t work. That is an observation that can be see in all browsers IIRC.

SVG folks actually get asked to support contentEditable. People want to use text along a path, have it selectable and editable. Just SVG can do that — but with the hack of above. Should we add contentEditable to SVGElement or Element seems to be the remaining question. This depends if there are similar scenarios in MathML (and other markup languages) as well.

Greetings,
Dirk

> 
> - R. Niwa
> 

Received on Monday, 14 July 2014 08:44:06 UTC