...

View Full Version : IE7 behavior: url memory leak?



windago
12-11-2006, 05:52 PM
Hi all,

There seems to be a lot going on with my particular problem. I hope I have this thread in the correct place. I will do my best to explain as it is even a bit confusing with me.

Background -
index.html
- Loads styles.css
- includes SecurIndex.php
- contains js function getCal

SecurIndex.php
- uses JS/XML get.document function (getCal) to load Calender.php into div cal1

Calender.php
- creates links for persons on call each day
- :hover on each name gives their contact info
- the hover box is a formated div
- there are generated links to go ahead one month or back by calling getCal()

styles.css
- uses the following IE fix:
- behavior: url('/TOCCalendar/IEFixes.htc');
- #infobox.hover div

So that is the basic setup on how things work. Now here is the problem. Everything works fine in Firefox, Opera, IE6. This brings us to IE7. Everything works just fine until the link to go forward or back a month is clicked. Suddenly CPU hits 90% and hangs as such for about 10 min. Using process explorer I found that a rather large number of ntdll.dll!RtlAllocateHeap+0x18c are being called, and IEFRAME.dll is hitting the high CPU. Did a lot of testing and found the problem relates to the behavior: call in my css file. I comment it out and the problem goes away, however the happy hovering div with contact info goes away. Still works in Firefox of course.

It was my understanding that the :hover pseudo class should be compliant in IE7, so should it not be the case that with behavior: and #infobox.hover div commented out (just leaving #infobox:hover div) it should work? And if not has anyone ever seen something like this happen, or know how I might use :hover in a compliant way for IE6, IE7 and the rest?

I can post any code that might help, but did not want to clutter this initial post with unneeded information.

Any help would be greatly appreciated,
Matt

_Aerospace_Eng_
12-11-2006, 07:30 PM
IE7 doesn't need the behavior as many bugs were fixed what you should do is something like this

<!--[if lte IE 6]>
<style type="text/css">
body {
behavior:url(hover.htc);
}
</style>
<![endif]-->
The above goes AFTER your linked stylesheet NOT in it. Once you do that remove the behavior call from your main stylesheet.

windago
12-11-2006, 09:09 PM
Thanks for the info. That will solve the problem of keeping IE6 working once I correct IE7. The problem is, when I take the behavior call out of my css IE7 stops displaying the hover also. So I am not entirely sure why it is not behaving like it should be.

Thanks!
Matt

_Aerospace_Eng_
12-11-2006, 11:37 PM
Can you post the rest of your code or give us a link? IE7 will work as expected only when it has a full valid doctype.

windago
12-12-2006, 02:53 PM
#####################EDIT##############################

Thanks _Aerospace_Eng_ you where right on the money. Once I pulled my head out of my fanny and woke up I was able to fix it.

I echo'd out the DOCTYPE call listed below in my index.php and boom problem fixed!! I have never really had to mess with using DOCTYPE in the stuff that I have done. Going forward that is some good stuff to know and I will need to read up more on it as I try to bring the age old code that was written in this place up to standard.

Thanks again!!!
Matt

####################################################333




I can't post a link as the site is internal at work. Checking the component pages I noticed a doctype was never set as you suggested. Should it be something like:



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


I would place that at the top of my index.php correct? Doing so I would not need to set it in each of the component parts pulled in correct? Below is the bits of the code I am using. I have not implement the first suggestion yet. Want to get IE7 working first hee hee.

*****EDIT**** just realized that I would do that in html documents. What method would I use in a php? *******

styles3.css


#infobox
{
behavior: url('/TOCCalendar/IEFixes.htc');
}

#infobox div
{
display: none;
width: 150px;
text-decoration: none;
position: absolute;
border: inset #000 1px;
background: #fff;
margin: 0px 0px 0px 0px;
padding-left: 3px;
color: black;
font-weight: lighter;
}

/***For Firefox***/
#infobox:hover div
{
display: block;
text-decoration: none;
margin-left: 25px;
}

/*****For IE*****/
#infobox.hover div
{
display: block;
text-decoration: none;
}


IEFixes.htc


<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="DoHover()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="RestoreHover()" />
<SCRIPT LANGUAGE="JavaScript">
function DoHover()
{
element.className += ' hover';
}

function RestoreHover()
{
element.className = element.className.replace(/\bhover\b/,'');
}
</SCRIPT>


index.php


<LINK REL=STYLESHEET TYPE="text/css" HREF="styles3.css">


Thank you sooo much for your help!!!
Matt

_Aerospace_Eng_
12-12-2006, 06:36 PM
php is html once its parsed. From the looks of things though you are using XHTML. Try using this doctype instead.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Remember nothing can go above the doctype or it will cause IE6 to not work properly as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum