Bug Tracker

Opened 10 years ago

Closed 10 years ago

#4232 closed bug (duplicate)

New :visible logic fails on hidden table rows in IE7

Reported by: cmlenz Owned by: john
Priority: critical Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

The new :visible logic introduced in 1.3.2 doesn't work correctly for hidden table rows in IE7, and probably IE6. Haven't tested IE8.

The issue is that IE still reports a >0 offsetWidth for the rows, only the offsetHeight is ==0. I'll attach a simple HTML page that demonstrates the problem.

I think the fix would be:

Index: src/selector.js
===================================================================
--- src/selector.js	(revision 6253)
+++ src/selector.js	(working copy)
@@ -958,7 +958,7 @@
 };
 
 Sizzle.selectors.filters.visible = function(elem){
-	return elem.offsetWidth > 0 || elem.offsetHeight > 0;
+	return elem.offsetWidth > 0 && elem.offsetHeight > 0;
 };
 
 Sizzle.selectors.filters.animated = function(elem){

Attachments (1)

offset_visible.html (821 bytes) - added by cmlenz 10 years ago.
HTML test page

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by cmlenz

Attachment: offset_visible.html added

HTML test page

comment:1 Changed 10 years ago by dmethvin

I tried a simple test case and it seems to work correctly with 1.3.2 in IE8 (all I have on this PC). Can you attach a case that fails in IE7 just to be sure?

comment:2 Changed 10 years ago by jerone

The test case fails correctly for IE6, IE7, IE8 RC1 for me.

comment:3 Changed 10 years ago by Heliologue

I can confirm this in IE6 and IE7.

comment:4 Changed 10 years ago by Heliologue

This ticket is duplicated (and fixed) in #4374. Looks like the aforementioned change to {{selector.js}} was made in r6282.

comment:5 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Dup/fixed #4374. Thanks Heliologue!

Note: See TracTickets for help on using tickets.