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 13893 - Only HTML elements should be editable
Summary: Only HTML elements should be editable
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - HTML Editing APIs (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Aryeh Gregor
QA Contact: HTML Editing APIs spec bugbot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 19:55 UTC by Aryeh Gregor
Modified: 2011-11-08 19:24 UTC (History)
4 users (show)

See Also:


Attachments

Description Aryeh Gregor 2011-08-24 19:55:36 UTC
Ehsan pointed out that it doesn't make any sense to let the user edit SVG or MathML unless the browser has a special editor for them.  We should make only HTML elements editable/editing hosts for now.  Embedded SVG/MathML should be treated as opaque, like an <img>.  This probably means the root node of the foreign content does need to be editable, so we know we can delete it, but we don't want to touch any of its descendants.
Comment 1 Ehsan Akhgari [:ehsan] 2011-08-25 02:50:51 UTC
Also, I think we should specify that a bunch of things should work for those subtrees, such as resizing, and copying to the clipboard.
Comment 2 Aryeh Gregor 2011-08-28 16:00:17 UTC
I'll want to define some category of content that includes img, video, audio, svg, math, maybe a few other things (hr?), and specify all of them to be draggable/resizable/etc.  Currently I treat some of these specially in some cases but not in others -- I should do some unification.
Comment 3 Anne 2011-08-30 07:22:49 UTC
HTML nested inside SVG should still be editable.
Comment 4 Aryeh Gregor 2011-08-30 16:54:39 UTC
We talked about that.  In theory maybe yes, but it might be complicated.  At any rate, as far as the spec is concerned, adding the contenteditable attribute to HTML-in-SVG-in-HTML can still be allowed, but I don't think it should inherit the editability of an HTML ancestor automatically.  <svg> should be treated similarly to <object> or <img src=foo.svg> by default, which means the whole thing is one big image.  Allowing parts to be editable would be a bit of a UI problem.
Comment 5 Ehsan Akhgari [:ehsan] 2011-08-30 19:09:56 UTC
(In reply to comment #4)
> We talked about that.  In theory maybe yes, but it might be complicated.  At
> any rate, as far as the spec is concerned, adding the contenteditable attribute
> to HTML-in-SVG-in-HTML can still be allowed, but I don't think it should
> inherit the editability of an HTML ancestor automatically.  <svg> should be
> treated similarly to <object> or <img src=foo.svg> by default, which means the
> whole thing is one big image.  Allowing parts to be editable would be a bit of
> a UI problem.

Yes.  To elaborate, I think we should treat SVG and MathML content as contentEditable="false" by default.  Therefore, any HTML content inside such elements should be treated as non-editable by default.  But of course the author might specify the contentEditable attribute on such elements explicitly.
Comment 6 Aryeh Gregor 2011-11-08 19:24:21 UTC
https://dvcs.w3.org/hg/editing/rev/f4f95c3f51d6

I'm not actually testing this requirement anywhere for the time being, since it's a bit niche.  There's no way to actually create <svg> or <math> right now using the editing APIs anyway.  But the requirement is now there.