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

Hello,

I edited Alan's webpage to fix the #NAME errors.

I also highlighted rows that show differences between the spec and current implementations. They are mostly around em values for margins and font-sizes. I do not know the history of why current values - in the spec and the implementations - were chosen. If anyone has any background please do share.

@Stewart, I agree on the missing rules.
- I believe a recent email from David Baron resolved the missing "tr {vertical-align: inherit}" rule. It should be added here.
- Adding td { padding: 1px} would make sense too.

Thanks,
Saloni



-----Original Message-----
From: Stewart Brodie [mailto:stewart.brodie@antplc.com]
Sent: Thursday, May 01, 2008 3:03 AM
To: Alan Gresley
Cc: Saloni Mira Rai; fantasai; www-style@w3.org
Subject: Re: [CSS21] Why are browser default style values different from Appendix D

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 Friday, 2 May 2008 00:01:48 UTC