W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: The formatblock command

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 4 Sep 2009 00:11:01 +0000 (UTC)
To: Simon Pieters <simonp@opera.com>
Cc: "public-html@w3.org" <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0909032334050.6775@hixie.dreamhostps.com>
On Wed, 3 Jun 2009, Simon Pieters wrote:
>
> Step 3 of the formatblock command 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#command-formatblock 
> says:
> 
>    If value is (now) an ASCII case-insensitive match for the tag name of an
>    element defined by this specification that is defined to be a
>    formatBlock candidate, then, for every position in the selection, take
> 
> Not clear to me what every position in the selection means.

I don't know how else to explain it. It's, like, every possible point that 
you could describe in the DOM, from the start of the range to the end of 
the range.


>    the furthest formatBlock candidate ancestor element of that position
>
> Mozilla, WebKit and Opera seem to use the nearest instead of the 
> furthest. IE seems to replace all formatblock ancestors and copies 
> attributes from the removed elements to the remaining (and the new) 
> formatblock elements. 
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/126
> 
> Please specify what IE does or change to nearest ancestor.

Changed.


>    that contains only phrasing content, and, if that element is editable
> 
> ...and is not an editing host. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/127

Done.


>    and has a parent element whose content model allows that parent to
>    contain any flow content,
> 
> This doesn't seem to match what browsers do.

Indeed. I do not want to condone having the APIs make invalid markup.


>    replace it with an element in the HTML
>    namespace whose name is value, and move all the children that were in it
>    to the new element.
> 
> Please specify that if no elements were changed in an editing host, 
> insert a new element as child of the editing host. 
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/130
>
> Also specify that new elements are inserted for <div 
> contenteditable>x<p>y</p>x<p>y</p>x</div>.

Where should the element get inserted? Different browsers seem to do very 
different things here.


> Please specify whether attributes survive in 
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/128 and 
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/129

I've specified that the attributes must be copied.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 4 September 2009 00:08:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:07 UTC