PC Review


Reply
Thread Tools Rate Thread

CSS height expression crash

 
 
=?Utf-8?B?V2lsbGlhbSBIdXJsZXk=?=
Guest
Posts: n/a
 
      11th Apr 2005
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.
 
Reply With Quote
 
 
 
 
C A Upsdell
Guest
Posts: n/a
 
      11th Apr 2005
William Hurley wrote:
> 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)
 
Reply With Quote
 
=?Utf-8?B?V2lsbGlhbSBIdXJsZXk=?=
Guest
Posts: n/a
 
      11th Apr 2005
Whoops, you're right. That's a transcription error on my part. Just checked
my code and it's there. Still crashing.

"C A Upsdell" <""cupsdellXXX"@-@-@XXXups" wrote:

> William Hurley wrote:
> > 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)
>

 
Reply With Quote
 
=?Utf-8?B?QWxleCBTY290dCBbTVNGVF0=?=
Guest
Posts: n/a
 
      22nd Apr 2005
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.



"William Hurley" wrote:

> 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.

 
Reply With Quote
 
=?Utf-8?B?TWFyayBX?=
Guest
Posts: n/a
 
      10th Jun 2005
WH,

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

Thank goodness I am not going crazy.

--Mark
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row Height stopped growing and Auot-Fit Row Height does not work PSULionRP Microsoft Excel Misc 0 19th May 2009 07:59 PM
Auto set height of vertical line to height of detail section Paul Kraemer Microsoft Access Reports 1 8th Jul 2008 03:18 PM
Width | Height Regular Expression jpero09@gmail.com Microsoft C# .NET 1 2nd Feb 2008 05:10 PM
measuring web controls height at runtime (or converting .height % to px) Wotney Microsoft ASP .NET 1 25th Oct 2006 02:39 PM
taskbar height doubled - can't change back to normal height Lyn Windows XP General 2 20th Oct 2003 11:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:06 AM.