W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2012

[whatwg] Request for feedback: supported elements for formatBlock

From: Ojan Vafai <ojan@chromium.org>
Date: Fri, 6 Jan 2012 18:47:24 -0800
Message-ID: <CANMdWTv19NxyjK8ZY473y5+umUgzdt8jHqQ9VUn2sn83NatEJw@mail.gmail.com>
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.
>
Received on Friday, 6 January 2012 18:47:24 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:10 UTC