W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: [editing] The spec about execCommand('indent') in inline block.

From: Ryosuke Niwa <rniwa@apple.com>
Date: Mon, 21 Apr 2014 11:04:54 -0700
Cc: Yoichi Osato <yoichio@google.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-id: <67EB6AED-CEEB-4BFC-ACB7-64CB3F06CD42@apple.com>
To: Ben Peters <Ben.Peters@microsoft.com>
I think the tricky issue is that a user can't tell whether lines are separated by br or by div at glance especially for pasted content.

- R. Niwa

On Apr 16, 2014, at 12:01 PM, Ben Peters <Ben.Peters@microsoft.com> wrote:

>> Image following HTML ('|' is the caret selection):
>> <span contenteditable="true" id="span">|text</span>
>> <script>
>> document.execCommand('indent', false, null);
>> </script>
>> Following current HTML editing, document.execCommand('indent') inserts a
>> blockquate element inside a span element.
>> https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#indent
>> Both Chrome and IE insert a blockquate element inside a span element.
>> You can try it on:
>> http://jsfiddle.net/xtk5h/2/
>> However, the blockquate element is a flow content and HTML standard doesn't
>> allow flow contents to be contents of a span element:
>> http://www.whatwg.org/specs/web-apps/current-work/#the-span-element
>> Which is better we allow indentation in inline element or not?
> My personal opinion (not shared by all at Microsoft) is that inline elements should not be broken for blockquote/list items. Indent commands should indent the entire block. Today, if you select several lines separated by <br> elements, and execute insertorderedlist in Chrome, it creates list items for each line. I feel like that breaks the user's model because <br> is created by shift-enter, and shift-enter in a list creates a new line in the same list item, not a new list item. 
> This is further complicated by Firefox creating <br> on enter instead of shift-enter though. I believe enter should create a block (p or div), and shift-enter should create br.
>        Chrome    Firefox        IE
> Enter        <div>        <br>        <p>
> Shift-Enter    <br>        <br>        <br>
Received on Monday, 21 April 2014 18:05:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC