[whatwg] Request for feedback: supported elements for formatBlock

Aryeh Gregor ayg at aryeh.name
Tue Jan 10 12:25:06 PST 2012


On Fri, Jan 6, 2012 at 9:47 PM, Ojan Vafai <ojan at chromium.org> wrote:
> 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).

What are examples of when you want this behavior, that aren't handled
as easily with the current spec?

> 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.

What are examples of when you want this behavior, that aren't handled
as easily with the current spec?

> 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).

What are some examples of things Closure needs to do with blockquotes
that aren't easily supported by the current spec?  (indent/outdent is
intended to be the way to change blockquote level, not formatBlock.)

> 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.

That's debatable.  In any event, I'd like to hear concrete use-cases
before changing the spec.  Real-world experience is valuable, but it's
also often based on having to work around browser bugs, which isn't as
important when writing a spec.  E.g., if you're using formatBlock to
handle blockquote because some browsers don't support indent/outdent
the way you want, but indent/outdent as specced will work fine for
your use-case, that's not a reason to change the spec.



More information about the whatwg mailing list