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

Is DSSSL Hard?

From: Hakon Lie <howcome@w3.org>
Date: Tue, 22 Apr 1997 11:12:23 -0700
Message-ID: <335CFECC.B7B@w3.org>
To: www-style@w3.org
CC: howcome@w3.org
Paul Prescod writes:

 > This is what I found in my test of DSSSL for a simple CSS-like
 > stylesheet. Stylesheets follow. 

Your comparision is interesting, although confrontational. This
message is not trying to argue that DSSSL is hard, but rather tries to
clarify some of your arguments and answer your questions about CSS.
Also, I add some DSSSL questions of my own. Let me also say that I
think DSSSL and CSS can live peacefully together, and that our 
energy is best spent promoting the concept of style sheets instead
of fighting syntax wars. 

 > Despite the fact that the DSSSL stylesheet is substantially
 > more complete, I do not believe it to be much more difficult to
 > understand or write than the CSS one.

In what way is the DSSSL style sheet more complete? The parts I see
missing in CSS are values (e.g on 'display') to declare TABLE as a
table, IMG as a replaced elements and BR as a paragraph break. In
DSSSL, I miss floating elements, anchor pseudo-classes and some
relative values (e.g. on 'font-weight'). Anything else? I believe the
missing parts can be added in both languages, and I don't see how you
can argue that one is substantially more complete than the other.

 > To show that this is
 > a trivial difference, it would be nice if I could show something that
is
 > easy in DSSSL, using a built-in flow object, (like tables or images),
 > but difficult in CSS. It goes both ways. A missing flow object is a
 > hassle, but the set of flow objects available are mostly an arbitrary
 > set that can be expanded as needed in future versions of the
standard. 

Exactly. It would be natural for CSS to add a TABLE flow object (to
borrow from DSSSL terminology), and I assume DSSSL would add the
ability to float elements through a new flow object?

 > As an
 > example, in the DSSSL code above, I could change the numbering style
 > from "1" "2" "3" "4" to "1.", "2.", "3.", "4." with three extra
 > characters. This simple change is absolutely impossible in CSS. No
 > matter how much work I am willing to put in, I cannot get this simple
 > effect. 

This is correct for CSS1 -- we dropped numbering in the first
specification since this was not on the top of the list for web
designers and implementors. However, there exists a proposal for how
to do numbering (and other added content) in CSS and you can expect it
in a forthcoming draft.

 > 2.In DSSSL you must
 > declare what "color-space" you are using, as RGB has many known
 > limitations. This is also one line of code.

Defining a new unit in one line of code sounds easy, but how do you
convey how the new unit is to interpreted? I would think that has to
go into a specification somewhere?

 > 3.You may also
 > define units in DSSSL and I added "em" to the list of defined units
for
 > ease of translation. This could also be predefined in
DSSSL-on-the-web.

Ditto.

 > Postscript on CSS

 > What does it mean for a display: inline
 > element to have a margin-left property? 

It means that extra space is added on the left side of the element. Do
you object to the terminology (arguably, we're not describing a
"margin"), or functionality (the fact that you can add space to the
left of an element)?

 > What does it mean for an inline
 > element to have a list-style: property?

The 'list-style' property does not apply to 'inline' elements -- it
only applies to it 'list-item' elements. See section 5.6.6 of the CSS1
Recommendation.

 > In my opinion, these nonsensical
 > or questionable combinations will become unmanagable in the future. 

Fresh. I don't really see how e.g. the last example differs from the
fact that not all DSSSL characteristics apply to all flow objects --
perhaps you could clarify?

 > CSS rules can be split into multiple sections, but the rules of which
 > sections will be called for which elements are complex: much more
 > difficult than those for DSSSL.

I don't understand this statement, could you give an example?

 > I also think that conflicting
 > cumulatively applied rules will cause a maintenance headache in large
 > stylesheets: "Why is that blue? Oh! I didn't know I had another rule
for
 > that down here." The sample stylesheet I was using had one such
mistake. 

Technically it's not a mistake. Conflicts are intrinsic to CSS and we
have clear rules for how to resolve them. But, as with any language,
nonsense can be expressed in CSS...

 > Extensions to CSS beyond its current level will only appeal to
 > professional Web publishers,

One of the extensions we are working on is ACSS: Aural Cascading Style
Sheets. This will enhance access to the Web for visually impaired
users -- only some of which are professional Web publishers...

 > CSS serves its purpose and did so before the DSSSL standard
 > was ready. It should be left a simple language that can appeal to
 > amateurs and occasional users. 

You're much too generous, Paul :-)

 > Note that the DSSSL stylesheet covers tables, images and paragraph
 > breaks. The CSS one cannot because CSS does not support these
features.

There's a couple of half-truths here. The CSS properties certainly
applies to tables and describe how they should be rendered. True, you
cannot declare that the TABLE element is a table but as you noted
above, flow objects can be added. As for images, CSS supports
floating, borders, padding, scaling etc. Again, it's not possible to
declare IMG to be a replaced element. In the context of HTML, this
hasn't been much of an issue, but as CSS is applied to XML this should
be added. 

I have some questions to your sample style sheets:

 > (define page-width 8.5in)	; these are just useful, not necessary
 > (define page-height 11in)

Could one define this in a manner that would work for both American
and A? sizes -- e.g. through client-side binding?

 > (element B (make sequence font-weight: 'bold))
 > (element STRONG (make sequence font-weight: 'extra-bold ))

The CSS style sheet you are replicating uses the 'bolder' value for
'B' and 'STRONG', i.e. a relative value. Using DSSSL, I assume you
could query the font weight of the parent element and add 1 or
something?

 > (element H5 
 >     (make paragraph
 > 	space-before: 1em
 > 	space-after: 0em
 > 	font-weight: 'bold
 > 	start-indent: (/ page-width 20)))

Note that percentage values in CSS is based on the dimension of the
parent element -- which may or may not be equal to the page width. How
would you express this?

 > (element P
 >     (make paragraph))

The CSS style sheet you are trying to replicate is:

 P {
   text-indent: 4%;
   margin-top: 0;
   margin-bottom: 0;
 }

I assume it would be easy to represent the text indent of 4%, how
would you do it?

From the sample CSS style sheet:

 > A:link { color: red }
 > 
 > A:visited { color: #336666 }
 > 
 > A:active {
 > color: red;
 > background: #FFFF00;
 > }
 > 
 > A:link IMG { border: 1px solid red  }
 > 
 > A:visited IMG { border: 1px solid #336666 }
 > 
 > A:active IMG { border: 2px solid #FFFF00 }

How would these be represented in DSSSL? I'm aware that there is no
DSSSL equivalent to pseudo-classes, but I assume it can easily be
added. Could you give an example of what the syntax could look like?

Regards,

-h&kon

H      k   o   n      W   i   u   m       L   i   e
howcome@w3.org   W o r l d   Wide  W e b  Consortium
inria # FRANCE http://www.w3.org/people/howcome
Received on Tuesday, 22 April 1997 10:59:19 GMT

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