[whatwg] Request for feedback: supported elements for formatBlock

Ojan Vafai ojan at chromium.org
Fri Jan 6 18:47:24 PST 2012


Coming to this discussion very late. Maybe this has already been resolved.

FormatBlock should be dumb. It should not try to think about what the
author's intended semantics are. It should work on all block elements and
should just do the simple changing of the block from whatever type it
currently is to the new one (and the associated wrapping of bare inlines in
a block).

In order to get the wrapping behavior, we should add a new command, e.g.
WrapWithBlock, that is similarly dumb and just wraps the contents with the
given block element.

In my experience working on the Closure editor, I have wanted both
behaviors. Blockquote specifically is a case where the Closure editor has a
ton of custom code to work around browsers having different behavior (or
not supporting the command at all).

Having both commands and having them both be simple in what they do lets
authors reason about what will happen and get the output they want. It is
simplest for web developers and for browser developers.

Ojan

On Fri, May 27, 2011 at 10:52 AM, Aryeh Gregor <Simetrical+w3c at gmail.com>wrote:

> On Thu, May 26, 2011 at 7:50 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:
> > What is IE's behavior in this case?
>
> IE just ignores <blockquote> as an argument to formatBlock, same as if
> you pass <quasit> or something.  That matches my current spec, but
> doesn't match any non-IE browser.  Gecko and Presto both try to wrap
> existing elements in some fashion, which means formatBlock to
> <blockquote> behaves differently from formatBlock to anything else.
>


More information about the whatwg mailing list