[triangle-zpug] KSS presentation posted
Jim Allman
jim at ibang.com
Thu Nov 29 01:54:18 CET 2007
On Nov 28, 2007, at 6:42 PM, Chris Calloway wrote:
> I guess it is important to emphasize that KSS is has CSS-compliant
> *syntax* (but not
> the same execution).
I'm not surprised. Having hand-coded a fair amount of AJAX jive, I
assume the usual stuff is happening behind the scenes: KSS is
registering JS functions as event handlers ("listeners") on the
chosen DOM elements. This is a very flexible and lightweight setup
that supports many-to-many relationships between notifiers and
listeners.
CSS, on the other hand, generally results in only one outcome for a
given combination of element and property. So if you say:
div#blah a:hover {
border: solid 1px green;
margin: 4px;
border: red;
}
... the red border color "wins", simply because it comes last in the
series. This is a consequence of the CSS cascade, and the fact that
for most (all?) CSS properties There Can Be Only One value for a
given element.
The CSS cascade has other interesting dynamics, like the notion that
a more specific selector trumps a more general ones. It will be
interesting to see how these play out in the more open-ended domain
of events and behavior. Not to mention the fact that the outcome of a
KSS rule can change the DOM, possibly affecting the outcome (and
genesis) of other KSS rules. Talk about a cascade!
> What would be interesting is to have two actions in one rule, both
> manipulating the same DOM node, and see which one wins. It is reported
> that you can put the actions and parameters in the rule in any order.
> But I wonder if order has an effect on the sequence of actions
> triggered
> in the KSS engine on the client.
My guess (I don't have the setup to try this) is that actions would
fire in order, but that server actions (being asynchronous) will be
unpredictable. In the event that an action's target nodes are no
longer available (clobbered by faster action), I'd hope the call
would fail gracefully as its node selector finds no target.
Super cool stuff, thanks again for the demo!
=jimA=
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
Jim Allman
Interrobang Digital Media
http://www.ibang.com/
(919) 649-5760
More information about the TriZPUG
mailing list