W3C home > Mailing lists > Public > www-style@w3.org > February 1997

RE: Positioning HTML Elements with Cascading Style Sheets

From: Jon Bosak <bosak@atlantic-83.Eng.Sun.COM>
Date: Mon, 3 Feb 1997 18:19:07 -0800
Message-Id: <199702040219.SAA00723@boethius.eng.sun.com>
To: www-style@w3.org
CC: bosak@atlantic-83.Eng.Sun.COM
[Todd Fahrner:]

| Effective scripting, much more so than effective table structure, is
| very unlikely to be generated by a robust WYSIWYG authoring tool.

Not necessarily.  PostScript is a programming language, and lots of
robust WYSIWYG authoring tools generate it.

| I fear that the programmers who are bringing us script-based solutions
| to style (J*SS, CSSOM, even DSSSL) have been conditioned by their
| education to deprecate the declarative, procedural nature of CSS in
| favor of Turing-complete approaches.

(I'm going to assume that "declarative, procedural" should read
"declarative, nonprocedural", since these two terms are usually
opposed in discussions like this.)

It's a mistake to put DSSSL into the same bag as scripting languages.
Yes, DSSSL is turing-complete; yes, it's a programming language.  But
a script language (at least the way I use the term) is procedural;
DSSSL very definitely is not.  DSSSL is entirely functional and
entirely side-effect-free.  Nothing ever happens in a DSSSL
stylesheet.  The stylesheet is one giant function whose value is an
abstract, device-independent, nonprocedural description of the
formatted document that gets fed as a specification (a declaration, if
you will) of display areas to downstream rendering processes.

[Steve Knoblock:]

| I've not worked with SGML directly but if we move toward SGML
| browsers, I think that will push for correctness and a 'content'
| philosophy.

With XML comes a new and more forgiving notion of "correctness"
(well-formedness) that I think people will like much better than the
SGML notion of validity.

| The declarative model supports what dtp people have already learned in
| making up real (as opposed to virtual) style sheets. I do not feel a
| programmatic stylesheet is necessary as long as constants (or whatever
| is appropriate) can be introduced for adjusting metrics (like margins
| or font size) to compensate for browser window settings, frames or
| video resolution.

I wish that it was possible to handle high-level formatting purely
declaratively, but experience has taught me otherwise.  Try these in a
purely declarative stylesheet:

* Generate a table of contents at this spot.

* Generate an index back here.

* Provide headers and footers based on the document or section title
(or today's date, etc.)

* Label this graphic "Figure C-5" if it stays in this appendix, but
automatically change it to "Figure 6-5" if I move this appendix up and
make it Chapter 6.

* Take this telephone book indexed by last name and display it as a
telephone book indexed by first name.

And a very simple example in memory of the late Herb Caen:

* Make every other paragraph in this sequence of paragraphs bold.  If
I add a paragraph in the middle, automatically change all the bold
paragraphs that follow it to medium and all the medium paragraphs that
follow it to bold.

These aren't contrived or artificial examples; they're dirt-normal
commercial publishing.  Without programming, you can't handle even the
last one.


 Jon Bosak, Online Information Technology Architect, Sun Microsystems
 2550 Garcia Ave., MPK17-101,           |  Best is he that inuents,
 Mountain View, California 94043        |  the next he that followes
 Davenport Group::SGML Open::ANSI X3V1  |  forth and eekes out a good
 ::ISO/IEC JTC1/SC18/WG8::W3C SGML ERB  |  inuention.
Received on Monday, 3 February 1997 21:19:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.1 : Thursday, 23 September 2004 18:03:58 GMT