Re: Font Style Elements

> I'll describe as best I can.  Lets pretend I have a Javascript app... 
[deletia]
> extracting ONLY the HTML 
> element(s) at that anchor, and no more.  In other words, the JS code can 
> grab 10 DOM nodes, which could sub-contain any number of other HTML 
> elements.
[deletia]
> parse-out the author-wanted style rules pointed-to by ID="my_div".
[deletia]

Maybe I've been reading too many semantics papers lately, but this
process sound suspiciously like beta-reduction (ie: function
application) in the lambda calculus. And if I may horribly abuse
programming language terminology, I think I can shed some light on the
debate:

-> Wingnut wants styles to be passed-by-value: all style-sheet
inheritance flattened to a single attribute.

-> The opposition wants styles to be passed-by-name: moving an element
requires costly substitution throughout its attached style tree.

In programming languages, pass-by-name has much more attractive
theoretical properties. However pass-by-value is much more efficient and
therefore almost always the choice of language implementers -- but only
in the case of simple types. When you get complex enough types (such as
Java Objects), the overhead to copy (flatten) its data (style) becomes
so great that they are usually passed-by-reference.

I was going to write that, for our purposes, pass-by-name and
pass-by-reference can be treated as identical; however then I realised
that there's actually a compromise between the two positions:
partial-document styles. What I mean is some mechanism that allows an
author to specify which style-sheets apply to a particular or set of
elements.

Now I'm by no means suggesting this is a good idea (I actually like
Idealised Algol!), I'm simply extending the metaphor to its conclusion.
You must admit that it does fulfill the desires of both parties, while
making the system amusingly more complex.

~ Jared Warren <warren@cs.queensu.ca>
Computing Science, Queen's University

Received on Wednesday, 5 March 2003 19:04:45 UTC