Re: The formatblock command

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