CSS height expression crash

G

Guest

I'm seeing an issue with CSS expressions in IE 6. With the following code:

<pre>
<html>
<head>
<title>Untitled</title>

<style>
div.data_row {
float: left;
clear: both;
width: 95%;
padding: 3px;
display: inherit;
visibility: inherit;
}

div.data_row div {
float: left;
}

div.data_row span.value {
border: 1px solid #CCCCCC;
padding: 0px 0px 0px 6px;
overflow: hidden;
text-align: left;
overflow-y: auto;
height: expression((this.scrollHeight < 18) '18px' : 'auto');
}
</style>

</head>

<body>

<div class="data_row">
<div style="width: 60%;">
<span class="value" style="width: 60px;"><input id="" name=""
style="display: none;" type="text" value=""></span>
</div>
</div>

</body>
</html>
</pre>

When this loads it hangs IE, you have to kill it from the task manager. If
there is visible element inside span.value then it works fine, it only
crashes if it is blank. Has anyone else run across this issue or have a
solution? Right now we're putting in an nbsp at the end, but I don't like
having to do that.
 
C

C A Upsdell

William said:
I'm seeing an issue with CSS expressions in IE 6. With the following code:
div.data_row span.value {
border: 1px solid #CCCCCC;
padding: 0px 0px 0px 6px;
overflow: hidden;
text-align: left;
overflow-y: auto;
height: expression((this.scrollHeight < 18) '18px' : 'auto');

I don't know much about the IE-proprietary 'expression' function, but if
it is like most programming languages, I would expect that you should
use this instead:

expression((this.scrollHeight < 18) ? '18px' : 'auto')

(note the question mark added)
 
G

Guest

Whoops, you're right. That's a transcription error on my part. Just checked
my code and it's there. Still crashing.
 
G

Guest

It looks like a circular reference caused by the child element with "display:
none". One possible work around is to apply a height to the span.

Reduced Code
<html>
<head>
<style>
#value
{
height: expression((this.scrollHeight < 18) ? '18px' : 'auto');
}
</style>
</head>
<body>
<span id="value" style="width: 60px; height: 0px;">
<input style="display: none;">
</span>
</body>
</html>


Alex Scott [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

WH,

I am experiencing the same thing. Just identified the empty <Div> tag this
morning.

Thank goodness I am not going crazy.

--Mark
 

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

Top