BeCSS

Can someone tell me what this is meant to be?

<HTML xmlns:LK="urn:com.microsoft.htc.samples.calc">
<HEAD>
<STYLE>
   LK\:CALC    { behavior:url(engine.htc); }
</STYLE>
</HEAD>

<LK:CALC ID="myCalc"
      onResultChange="resultWindow.innerText=window.event.result">
<TABLE>
<TR><DIV ID="resultWindow" STYLE="border: '.025cm solid gray'"
         ALIGN=RIGHT>0.</DIV></TR>

Bearing in mind:

1. <!ELEMENT STYLE - - %StyleSheet        -- style info -->
<!ATTLIST STYLE
  %i18n;                               -- lang, dir, for use with title
--
  type        %ContentType;  #REQUIRED -- content type of style language
--


2. <!ELEMENT TR       - O (TH|TD)+        -- table row -->

3. 4.1.2 Keywords
Keywords have the form of identifiers. Keywords must not be placed
between quotes ("..." or '...'). Thus, red is a keyword, but "red" is
not. (It is a string.) Other illegal examples:
width: "auto";
border: "none";
font-family: "serif";
background: "red";

(This rather has me in mind of the SVG specification, which includes
such delights as these: 
'<style type="text/css"><![CDATA[
      .TitleText { font-size: 16; font-family: Helvetica } ]]>
    </style>',

(But at least the example in BeCSS doesn't purport to be CSS (perhaps
it's one of those mysterious Hypertext Style Sheets that certain
products seem to think are contained in .css files))

and 
'The default style sheet below is expressed using CSS syntax ... :

...
svg { width:attr(width); height:attr(height) }
'

It's always good when one specification decides what syntax another
specification will adopt (kind of like if CSS decided that a URI starts
with 'http://' and includes 'www' and '.com', don't you think?).

And there's also some rather strange 'JScript':

<SCRIPT LANGUAGE="JScript">
...
function onclick_handler()
{
   var i;
   var sDisplay;

   // Determine current state of the list (i.e. expanded or collapsed)
   // based on the current display property of the child.
   bCollapsed = (document.all(child).style.display == "none");
  
This seems to be a case of trying to put round brackets in a square
hole....


   if (bCollapsed)
   {
      element.style.listStyleImage =
"url('/workshop/graphics/blueminus.gif')";
      element.style.display = "";

I presume the intention here is that if the element is hidden, to unhide
it, but of course this declaration is invalid, and will be ignored,
won't it?

(I'm not even going to mention:

<!ELEMENT SCRIPT - - %Script;          -- script statements -->
<!ATTLIST SCRIPT
  charset     %Charset;      #IMPLIED  -- char encoding of linked
resource --
  type        %ContentType;  #REQUIRED -- content type of script
language --

(Forgetting the strict absence of any language attribute in the HTML dtd
of course)
)

In addition:

There is actually no way to add event-driven script to XML. 
...
But:


<LK:CALC ID="myCalc"
      onResultChange="resultWindow.innerText=window.event.result">


And what specification is that one (onresultchange) in then?

And also:

<SCRIPT LANGUAGE="ECMAScript" >

Ignoring the blatant disregard for valid HTML (in what one assumes will
eventually become a W3C specification!), I find it curious to note the
use of 'ECMAScript', especially given the rest of the document's use of
'Jscript'; I would be interested to learn precisely which version of
ECMAScript includes this:

switch ( direction )
    {
    case 0:     // left
        x = -100;
        xScaler = 5;
        y = 0;
        yScaler = 0;
        break;
    case 1:     // top
        x = 0;
        xScaler = 0;
        y = -100;
        yScaler = 5;
        break;
    case 0:     // right
        x = 100;
        xScaler = -5;
        y = 0;
        yScaler = 0;
        break;
    default:    // bottom
        x = 0;
        xScaler = 0;
        y = 100;
        yScaler = -5;
        break;
    }

(perhaps it's ECMAScript++ :-))


Furthermore, the case statements are also wrong - the third one should
be case 2.

And also which version of ECMAScript will _ever_ include this:

   element.style.position = "relative";

        window.clearTimeout( timer );
        element.style.left = "0";
        element.style.top = "0";
        var eventElem = document.getElementsByTagname( "public:event"
)[0];
    element.style.left = x;
    element.style.top = y;
        timer = window.setTimeout( "tick()", 100 );
    alert( "x is '" + x + "%', y is '" + y + "%'." );

(Hint: ECMAScript is not synonymous with JavaScript (a shorthand it
seems increasingly fashionable to use) - it doesn't include any kind of
client-side objects, never will do and was never intended to.

There are countless similar errors scattered throughout.

There is also a typo:
Event handlers are triggered by state changes and can be combined to
create an arbitrariy state machine. 

On another issue:

A @script rule can take one of the following forms:
An @script followed by a script language content type but no script
content can be used to specify the default scripting language for all
event property values and script blocks in a style sheet: @script
"text/javascript";

This really isn't practical. There should be facility to add the version
of the scripting language. E.g., @script [MIMETYPE [LANGUAGE]?]?. So for
example, @script "text/javascript" "JavaScript1.4";

PS I don't think those references to JScript are appropriate either,
given that this looks nothing like JScript 1, which 'JScript' matches.)

Received on Wednesday, 19 April 2000 07:45:20 UTC