Bug Tracker

Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#4673 closed bug (duplicate)

:visible bug with table rows in IE6 and IE7

Reported by: bostanio Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:


The performance improvements introduced to the 'visible' selector in 1.3.2 introduced a bug with table rows in IE6 and IE7. The root cause is likely a buggy implementation of offsetWidth in those browsers. Consider this html test case:

	<script type="text/javascript" src="/jquery.js"></script>

	<script type="text/javascript">
			alert("Rows: " + $("tr").length + ". Visible Rows: " + $("tr").filter(":visible").length);
	<table cellspacing="0" cellpadding="0">
		<tr style="display: none;">

You would expect the alert to tell you there are two rows and one visible row.

However IE6 and IE7 consider both rows to be visible. FF3, GC and IE8 give the right answer.

Change History (2)

comment:1 Changed 14 years ago by bostanio

Note that jQuery 1.3.1 did not have this problem.

I'm mostly convinced that the problem lies with the IE implementation of offsetWidth in IE. However given that this worked in 1.3.1 it might be on jQuery to have a work around. There may be other situations where IE is equally buggy with similar effects.

Note that there are some subtleties to the IE bug. For example if all the rows of the table are hidden with "display: none" AND the table is styled with "border-collapse: collapse" then the above jQuery alert with zero visible rows. However if there are some visible rows and some hidden rows I've been unable to find any css or html combination that tricks IE into the right calculation of offsetWidth.

comment:2 Changed 14 years ago by dmethvin

Resolution: duplicate
Status: newclosed

This is a dup of #4512 and is being discussed actively on the jQuery-dev Google group.

Note: See TracTickets for help on using tickets.