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 14578 - Figure out how to behave if editing host is an inline element
Summary: Figure out how to behave if editing host is an inline element
Status: NEW
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-10-27 21:00 UTC by Aryeh Gregor
Modified: 2012-12-04 02:03 UTC (History)
4 users (show)

See Also:


Attachments

Description Aryeh Gregor 2011-10-27 21:00:24 UTC
Currently I generally just don't test this case.  Example: what happens if you run insertOrderedList on <span contenteditable>foo[]</span>?

IE9: <span contentEditable=""><p>foo</p></span>
Firefox 9.0a2: Throws NS_ERROR_FAILURE
Chrome 16 dev: <span contenteditable=""><ol><li>foo<br></li></ol></span>
Opera 11.50: Throws NOT_FOUND_ERR

How about <div contenteditable><span contenteditable>foo[]</span></div>?

IE9: <div contentEditable=""><span contentEditable=""><p>foo</p></span></div>
Firefox 9.0a2: <div contenteditable=""><ol><li><span contenteditable="">foo</span></li></ol></div>
Chrome 16 dev: <div contenteditable=""><ol><li>foo<br></li></ol></div>
Opera 11.50: <div contenteditable=""><ol><li><span contenteditable="">foo</span></li></ol></div>

<span contenteditable><ul><li>foo[]</ul></span>?

IE9: <span contentEditable=""><ol><li>foo</li></ol></span>
Firefox 9.0a2: NS_ERROR_FAILURE
Chrome 16 dev: <span contenteditable=""><ol><li>foo<br></li></ol></span>
Opera 11.50: <span contenteditable=""><ol><li>foo</ol></span>

I see three sensible options:

1) Pretend the editing host isn't inline, and give it block children.

2) Silently refuse to add new block elements if there's no ancestor in the same editing host that they're allowed children of, but otherwise execute the commands normally.  E.g., insertOrderedList should refuse to insert lists but should change existing <ul>s.

3) Bail out of all block-level commands unconditionally if the editing host is inline.

I'm leaning toward (2).  Opinions?