W3C home > Mailing lists > Public > www-style@w3.org > May 2008

Re: [CSS21] Why are browser default style values different from Appendix D

From: Stewart Brodie <stewart.brodie@antplc.com>
Date: Thu, 1 May 2008 11:02:54 +0100
To: Alan Gresley <alan@css-class.com>
Cc: Saloni Mira Rai <salonir@microsoft.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <7f953b3b3b810e0119b2b712e6a71f2f1bc139b0@localhost>

Alan Gresley <alan@css-class.com> wrote:

> 
> Saloni Mira Rai wrote:
> > Hello,
> > 
> > The attached CSV file contains the table with default styles by browser
> > is attached.
> > 
> > Thanks, Saloni
> 
> 
> Hi Saloli
> 
> Thank you. Some work you have done there but I find CVS hard to follow 
> so have used a trick I developed 6 years ago.
> 
> http://css-class.com/test/css/defaults/UA-style-sheet-defaults.htm

Anyway, thanks to both of you for preparing that - it makes it much easier
to see.

I don't know why, but Firefox made a complete pig's ear of trying to print
that page.  It showed the thead on one page (and nothing else), then the top
of the table on page 2, then the thead again on page 3 (and nothing else),
and then nothing further at all!  Opera managed to print it OK at the second
attempt (but wouldn't print it landscape - it missed out half the rows
completely)

I've compared it against our default strict mode stylesheet and found very
few differences between appendix D and what we do.

The main differences are:

1) additional pseudo to represent computed directionality context of an
element so that left and right margins can be interchanged for any element
that has non-equal left and right margins.

2) some odd looking rules for table components - I don't know the history of
these, but it's probably to work around common content issues:
   tr { vertical-align: inherit }   th { vertical-align: middle }

3) td { padding: 1px }

4) anything that wants to be centred but is display:block has a special
value for text-align instead of center because text-align:center doesn't do
the right thing (applies to CENTER and HR elements only, afaict)

5) many more properties on all the form controls (border, cursor,
background-color, color, and three further proprietary properties to control
focus and user interactivity)


Obviously, we also have rules for lots of extra elements not listed in the
table at all:

a, abbr, acronym, applet, area, dfn, embed, iframe, img, isindex, listing,
marquee, nobr, noembed, noframes, noscript, object, optgroup, option,
plaintext, q, script, style, title, wbr, xmp

There are other elements that deliberately have no explicit rules in the
default stylesheets because either the defaults are sufficient or they are
handled by explicit knowledge inside of the layout engine:

base, basefont, bdo, bgsound, font, label, legend, link, map, meta, param,
span


-- 
Stewart Brodie
Software Engineer
ANT Software Limited
Received on Thursday, 1 May 2008 10:03:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:06 GMT