infinite loop in CSS expressions?

Y

yawnmoth

I've been expirementing with CSS expressions and have encountered a
problem that doesn't make a lot of sense to me. After playing around
with it, I've managed to reduce it to the following:

<a href="#" style="margin-top:expression(alert('test'))">test</a>

Basically, the expressions seem to be called over and over again. In
this case, an alert box keeps poping up. It's almost like "while (1)
alert('test')", in fact, save for the fact that, initially, it only
seems to "alert" twice. Then as you move the mouse it alerts more and
then it just seems to get caught in an infinite loop, regardless of
where the mouse is.

Any ideas as to why?

(also, I'm aware that this is probably not the best approach to be
taking to solve the problem I'm, ultimately, trying to solve. I'll
probably investigate other approaches, later, but that doesn't mean
that I can't, in the interim, attempt to figure out why this approach
isn't working when it seems to me like it should)
 
R

Randy Webb

yawnmoth said the following on 6/27/2006 10:31 PM:
I've been expirementing with CSS expressions and have encountered a
problem that doesn't make a lot of sense to me. After playing around
with it, I've managed to reduce it to the following:

<a href="#" style="margin-top:expression(alert('test'))">test</a>

Basically, the expressions seem to be called over and over again.

It appears that IE continuously tries to determine the top margin for
it. Not sure why it would, but that is what it seems like it is doing.
 
M

Matt Kruse

yawnmoth said:
Basically, the expressions seem to be called over and over again.

This is the biggest problem with expressions - they are evaluated
continuously with any event anywhere on the page. So they quickly cause the
browser to slow to a crawl if you are using them for anything significant.

IMO, expressions would work better if they were only evaluated if something
connected to them changed and forced the expression to be re-evaluated. As
they stand, I've used them only in very limited situations because of the
performance hit they come with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top