Re: Objection to HTMLWG ISSUE-144 Change Proposal #2 (keep u non-conforming)

On Fri, Apr 1, 2011 at 10:37 PM, Leif Halvard Silli
<xn--mlform-iua@xn--mlform-iua.no> wrote:
> Aryeh Gregor wrote, on Fri, 1 Apr 2011 18:14:48 -0400
>
>> That means <u>
>> and <tt> should be; <blink> should not because it's not commonly
>> wanted, and is arguably extremely unwanted; <font> and <center> and
>> align= should not because they don't follow the CSS model.
>
> How doesn't <center> "follow the CSS model"?

Its descendants are all centered in a fashion that cannot be specified
using CSS rules (or if it can, I don't know how and have never heard
of it).  For instance, consider the following markup:

data:text/html,<!doctype html><center>
<div style="height: 10em; width: 10em; background: blue"></div>
<div style="height: 10em; width: 20em; background: red"></div>
</center>

The <center> here cannot, as far as I know, be replaced by any <div>
with inline style on the div alone that achieves the same results.
The CSS way to do this is

data:text/html,<!doctype html>
<div style="height: 10em; width: 10em; margin: 0 auto; background: blue"></div>
<div style="height: 10em; width: 20em; margin: 0 auto; background: red"></div>

which requires changing the descendants' style.  More problematically,
the way you have to change the descendants' style is not a way that
can be expressed in CSS rules, or at least I haven't heard of it being
done and the HTML5 spec doesn't try.  Block children need their
margins changed, but not if they already have margins specified, and
you don't want to specify margins on inline children, etc.  The effect
is just not compatible with the way CSS works.  That's why HTML
defines <center>'s effect in terms of the non-CSS concept of "aligning
descendants" that it makes up:

http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#align-descendants

Because it can't be done using only CSS rules.  Actually, the way
<center> works is often much more intuitive and useful than the way
CSS centering works, and it would be great if CSS were updated to
accommodate it.  But until that time, allowing <center> would mean
that layout on a conforming HTML page is not handled completely by
CSS, which is a major conceptual complication that I agree is enough
grounds to prohibit it.

Received on Sunday, 3 April 2011 17:52:00 UTC