Re: Behavioral Extensions to CSS

>From: Bjoern Hoehrmann <derhoermi@gmx.net>
>Date: Thu, 02 Aug 2001 22:05:18 +0200
>
>* Jeffrey Yasskin wrote:
> >And how do you attach these events to the XML elements?
>
>That's a problem for the relevant markup language. If you really want a
>generic method (and I can't see any good reason why there should be
>such) introduce something similar to <?xml-stylesheet ... ?> for scripts
>and not abuse CSS for this purpose.
>

I maintain that this is not CSS-abuse. An <?xml-script ... ?> PI would work 
for attaching events to an XML document using the DOM Events Rec, but I 
don't think it's the best way. See below.

> >The same could have been said about basic CSS when it was released. No
> >browsers had CSS support, and using pure CSS meant your pages looked
> >horrible in plain HTML browsers.
>
>If they were horribly marked up, possibly, but pages didn't break
>without CSS support.

And they shouldn't break without JavaScript.

>
> >Should CSS not have been developed for this reason?
>
>You want to require support for _two_ supplemental technologies to make
>use of _one_ supplemental technologie, that's nonsense.

Not require. The old methods of attaching JavaScript to HTML will still 
work. If an author chooses to make it easier on him/herself by using 
behaviors, they assume the risk that some browsers will not support it, just 
as by using pure CSS, they assume the same risk.

>
> >In HTML, will that addEventListener be in the onload event?
>
>Please read the DOM Level 2 Events recommendation.

I did. It doesn't address where you should call the addEventListener method. 
I believe that most event registration will be done onLoad. I ask again: If 
it runs every time the page loads, why shouldn't it be declarative instead 
of programmatic?
There are (at least) two ways to transform XML documents: SAX (programmatic) 
and XSLT(declarative). XSLT is much easier to write, but if you need more 
flexibility, you use SAX. I think the same type of arrangement should be 
made with events.

>
> >JavaScript is more concerned with the appearance and behavior of
> >a page than it is with the content.
>
>As is CSS.

So why is adding scripting support, which is mostly concerned with the 
appearance and behavior of a page, an abuse of CSS, which is mostly 
concerned with the appearance and behavior of a page?

I believe, and I may be alone on this, that the true test of when CSS is a 
completely functional language is when it can be used to take an arbitrary 
XML grammar and make it as powerful as HTML. I should be able to make up a 
set of XML tags and, after linking it to a CSS stylesheet, make it do 
anything an HTML 4 page can do. At the moment, I can't, and I won't be able 
to until scripting support is added to XML.

Jeffrey Yasskin

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Received on Thursday, 2 August 2001 19:51:18 UTC