cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <>
Subject RE: [RT] Getting rid of the table-based layout
Date Thu, 17 Oct 2002 21:19:50 GMT
I think we all hate table-based layouts and would prefer to use CSS. It
would be much easier to design and specify the look and feel using CSS. It's
more concise ... there are a thousand reasons.

But Nicola's point is valid: if browsers are going to CRASH (even a few
browsers) then that's one BIG reason against it :-(

Eventually the non-compliant browsers WILL disappear and these problems will
go away; we'll be able to port all our designs to CSS. But do we really need
to wait until then?

It seems to me that a Cocoon pipeline could implement a standard "CSS
compatibility layer" for the non-CSS browsers. These browsers would receive
HTML pages with the CSS modified or removed, and replaced with "structural
html". The CSS interpreter wouldn't be perfect, in fact it could even be
ugly, but even if it produced poor-quality layout for non-CSS browsers, it
would let the large majority of users (with compliant browsers) enjoy the
advantages of CSS, instead of waiting for everyone to catch up.

I suggest we would need:

1) a CSSGenerator to convert the CSS to XML as SAX (a wrapper around the
batik SAC parser).

2) a CSSCascadeTransformer to "cascade" the styles and apply them to the
document being styled. This would copy the appropriate style attributes to
each element of the document.

3) A formatter to convert the XHTML document with CSS attributes into
"table-layout" XHTML. This could use XSLT, or an HTMLCSSLayoutTransformer.
Also, the same technique could be used to apply CSS stylesheets to other XML
documents, particularly XSL-FO. Then we could use CSS for PDF, Rich Text
Format, SWF, etc. These would all need their own formatter of course.

There are some obvious mappings between the CSS concepts and non-CSS HTML:

the viewport -> table (so the entire page would always be enclosed in a
block-level box element -> table row (containing another table)
flow and positioning -> table/row/cell/@width @height @colspan @rowspan etc.
font and color formatting -> font tags and "color" and "bgcolor" attributes.

I've been thinking of doing this myself, but I am too busy and I just don't
have the time, although it would be very useful to me. I'd be interested to
know if anyone would consider collaborating on it?



> -----Original Message-----
> From: Nicola Ken Barozzi []
> Sent: Thursday, 17 October 2002 20:43
> To:
> Subject: Re: [RT] Getting rid of the table-based layout
> Tony Collen wrote:
> > On Wed, 16 Oct 2002, Nicola Ken Barozzi wrote:
> >
> >
> >>Koen Pellegrims wrote:
> >>
> >>>YES! Please!
> >>>
> >>>The current layout is not flexible at all and I for one
> would welcome a
> >>>simple, CSS-based design.
> >>>I would do it myself if it wasn't for the time, or the
> lack thereof... ;-)
> >>
> >>Soon we'll use
> >>
> >>It's not only CSS because some older browsers *crash* on
> CSS instead of
> >>ignoring it.
> >
> >
> >
> > Crash? wow... I've never seen it *that* bad, but I suppose
> that's what
> > testing is for, eh? :)
> ;-)
> > I've always done design work and tested against
> > Netscape 4.x, and not had any problems, but that was on a
> windows box,  so
> > who knows about other platforms.  I know Mozilla likes to
> crash on the
> > Sun boxes here at school when trying to render pages the
> Win32 version has
> > no problems with.
> [FYI]
> --
> Nicola Ken Barozzi         
>              - verba volant, scripta manent -
>     (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message