W3C home > Mailing lists > Public > public-css-testsuite@w3.org > January 2012

[RC6] data-alignment-003 is imprecise

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Wed, 11 Jan 2012 18:57:49 -0800
Message-ID: <8ffe12027ac0f8e48a5c1b3f3356dc63.squirrel@gtalbot.org>
To: "Arron Eicholz" <arron.eicholz@microsoft.com>
Cc: "Public CSS test suite mailing list" <public-css-testsuite@w3.org>
Arron,

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/data-alignment-003.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/data-alignment-003.htm


line 8         <meta name="assert" content="Cell data in a row can be
horizontally and vertically aligned." />

line 9         <style type="text/css">

line 10             tr

line 11             {

line 12                 vertical-align: middle;

line 13                 text-align: center;

line 14             }


The meta assert text and the CSS code assume (and more or less state,
without nuance, without necessary precautions) that vertical-align can
apply to tr elements and, because it may seem to apply, td cells will be
vertically aligned accordingly. But, that is not so.

The given code works because most, if not all, user agents have in their
default user agent stylesheet

thead, tbody,
tfoot           { vertical-align: middle }
td, th, tr      { vertical-align: inherit }
/*
Appendix D. Default style sheet for HTML 4
http://www.w3.org/TR/CSS21/sample.html
*/

or they may have

td, th      { vertical-align: middle }
/*
according to
Internet Explorer User Agent Style Sheets
http://www.iecss.com/
*/

Setting directly 'vertical-align: middle' into the td rule would be okay.

What is currently missing in the test code is an explicit inheritance in
the test code (and not relying on the user agent default stylesheet)
because vertical-align does *not* apply to tr elements and
vertical-align is not inherited.

Proposed correction
-------------------

    10             tr

    11             {

    12                 text-align: center;

    13             }

    14             td

    15             {

    16                 vertical-align: middle;

    17                 width: 10em;

    18                 height: 10em;

    19                 border: solid;

    20             }


Another idea would be to add 'vertical-align: inherit' (explicit and
active inheritance from tr to td in author stylesheet) into the td rule
of current code.

The text assert could also be a bit more careful by stating that
vertically aligning cell data can only be done at the cell level and not
at the row level... and be perfectly coherent with the spec and
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/vertical-align-applies-to-004.htm

regards, Gérard
-- 
Contributions to the CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

CSS 2.1 Test suite RC6, March 23rd 2011:
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

CSS 2.1 test suite harness:
http://test.csswg.org/harness/

Contributing to to CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Thursday, 12 January 2012 02:58:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 12 January 2012 02:58:41 GMT