Welcome to WebmasterWorld Guest from 54.161.100.24

Forum Moderators: open

Message Too Old, No Replies

Suspected bug in IE6, unwanted repeated characters

suspected IE6 bug repeating characters

     
9:50 pm on Dec 10, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 10, 2004
posts:5
votes: 0


Hi All,

Have been having some trouble with what appears to be a bug in IE6. I've googled for it and haven't come up with anything. Seems to affect both systems running XP SP1 and XP SP2 (other OS's also likely). I managed to boil it down to a small test case to demonstrate:

<html><head></head><body>

<div style="float:left">
</div>

<div style="float:left">
</div>

<!-- Both comments must be here for bug -->
<!-- Both comments must be here for bug -->

<div style="float:left; width:100%">
Repeated characters
</div>

</body></html>

Now the output will look like this:


Repeated characters

rs

The "rs" in this case are the characters at the end of the line. If you try to copy them to the clipboard they appear not to exist, but you can see them on the screen. You should be able to duplicate this on your own machine by copying and pasting the HTML above. Would someone care to confirm this for me?

Interestingly if you delete either comment, or modify pretty much anything (like remove the floats, change the width from 100% to 99%) the problem disappears.

Mark

10:23 pm on Dec 10, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Nice dectective work, there, in narrowing it down.

The issue seems to be completely with IE6, regardless of which Windows version. I see it on a Win98 se machine. But there is no problem in IE4 or 5.

The odd thing is which unwanted characters show up. I used the line "Try anything at all" and got a spurious "1."

11:01 pm on Dec 10, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 7, 2004
posts:39
votes: 0


You can remove the comments, or any other undisplayed code, eg {display: none;} from between floats. Alternatively try {margin-right: -3px;} on the last left float or {margin-left: -3px;} on the last right float.

This seems to be a 'has layout' issue. It may be that hacks such as {display: inline;}, or {display: inline-block;} on the float or {position: relative;} on the float and its parent, or the Holly Hack on the parent may work. Not tested.

Big John has an article, "Explorer 6 Duplicate Characters Bug", on his site that discusses this bug.

I don't know if I'm allowed to post the link. If a Mod would step in, I'd appreciate it.

cheers,

gary

11:28 pm on Dec 10, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


[positioniseverything.net...] gives a thorough look at the bug
5:27 am on Dec 11, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 10, 2004
posts:5
votes: 0


Hi guys,

Thanks for that information - I wish I'd come across that page a long time ago - it would have saved me a lot of time!

So it seems that the bug is known, and well documented. I'm going to assume that MS knows about the bug, and has known about it for some time (though I didn't see mention that it had been reported to them). I also assume that it won't get fixed anytime soon...

As far as work-arounds go, I'll have to go with removing of comments version. The reason is that my test case above was actually a severely reduced version of a very complicated bit of script-generated HTML for displaying thumbnails and names and descriptions of sub-folders in online photo albums. Due to the complexity, mostly required to make the output look the same in both IE and browsers that actually work properly, changing any of the layout elements themselves could break something, but I'll think about it and give it a go.

Actually it was interesting to read about the 3px of extra width given to a floated container. I recently came across this where I put 4 containers each exactly 200 pixels into a container of 800 pixels. Instead of sitting side by side the last one wrapped. When I set the container to 803 pixels it worked! I didn't think this was related to the same bug, but now I see that it was.

Background info: If anyone is interested, I'm the author of a popular skin for a photo album application, and some users were reporting this in their generated photo albums, which lead me to this investigation.

<Sorry, no personal URLs. See TOS [webmasterworld.com]>

We also found another work-around which was to add padding by way of a series of &nbsp following the text which seemed to be repeated. Actually what was then being repeated were the spaces, so they weren't visible. This seemed to work fine, until someone who had about 20 sub-folders in their album reported the problem again. It seemed that the more times you repeat the earlier floating containers, the more text gets repeated, so eventually it didn't matter how many &nbsp were inserted, text still spilled over.

Thanks for the extra info and pointing me to that site - I can certainly sleep easier now!

Mark

[edited by: tedster at 5:52 am (utc) on Dec. 11, 2004]

5:56 am on Dec 11, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 7, 2004
posts:39
votes: 0


Hi Mark,

Glad I could have a small part in this, even if it was only pointing to the man with the plan.

I seem to recall someone, probably in this forum, mentioning that the comments could be moved to reside in the elements rather than between them and it was equivalent to removal. I've only had this happen to me once (and that's enough), so I haven't tested that or any of the other possible cures. Maybe a test case or two&hellip;
cheers,

gary

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members